@networkpro/web 1.5.2 → 1.6.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 (108) hide show
  1. package/CODE_OF_CONDUCT.md +1 -0
  2. package/LICENSE.md +5 -39
  3. package/README.md +319 -39
  4. package/cspell.json +65 -0
  5. package/eslint.config.mjs +2 -1
  6. package/jsconfig.json +2 -1
  7. package/netlify-functions/cspReport.js +68 -0
  8. package/netlify.toml +17 -8
  9. package/package.json +52 -56
  10. package/playwright.config.js +21 -19
  11. package/postcss.config.mjs +1 -0
  12. package/scripts/auditScripts.js +1 -0
  13. package/scripts/bundleCss.js +1 -0
  14. package/scripts/checkEnv.js +1 -0
  15. package/scripts/checkNode.js +46 -19
  16. package/scripts/checkVersions.js +1 -0
  17. package/scripts/flattenHeaders.js +1 -0
  18. package/scripts/validateHeaders.js +1 -0
  19. package/src/app.d.ts +14 -3
  20. package/src/app.html +7 -49
  21. package/src/global.d.ts +1 -0
  22. package/src/hooks.client.ts +16 -7
  23. package/src/hooks.server.js +91 -0
  24. package/src/lib/components/Badges.svelte +1 -0
  25. package/src/lib/components/ContainerSection.svelte +1 -0
  26. package/src/lib/components/FullWidthSection.svelte +15 -1
  27. package/src/lib/components/LegalNav.svelte +1 -0
  28. package/src/lib/components/Logo.svelte +1 -0
  29. package/src/lib/components/MetaTags.svelte +1 -0
  30. package/src/lib/components/PWAInstallButton.svelte +1 -0
  31. package/src/lib/components/RedirectPage.svelte +20 -12
  32. package/src/lib/components/SocialMedia.svelte +1 -0
  33. package/src/lib/components/foss/FossFeatures.svelte +58 -4
  34. package/src/lib/components/foss/FossItemContent.svelte +2 -1
  35. package/src/lib/components/layout/Footer.svelte +4 -1
  36. package/src/lib/components/layout/HeaderDefault.svelte +2 -1
  37. package/src/lib/components/layout/HeaderHome.svelte +2 -1
  38. package/src/lib/data/fossData.js +271 -68
  39. package/src/lib/images.js +10 -1
  40. package/src/lib/img/logo-web.png +0 -0
  41. package/src/lib/img/logo-web.webp +0 -0
  42. package/src/lib/img/posts/eauth.png +0 -0
  43. package/src/lib/img/posts/eauth.webp +0 -0
  44. package/src/lib/index.js +1 -0
  45. package/src/lib/meta.js +1 -1
  46. package/src/lib/pages/AboutContent.svelte +1 -0
  47. package/src/lib/pages/FossContent.svelte +2 -1
  48. package/src/lib/pages/HomeContent.svelte +1 -0
  49. package/src/lib/pages/LicenseContent.svelte +33 -3
  50. package/src/lib/pages/PrivacyContent.svelte +33 -12
  51. package/src/lib/pages/TermsConditionsContent.svelte +3 -0
  52. package/src/lib/pages/TermsUseContent.svelte +3 -0
  53. package/src/lib/registerServiceWorker.js +35 -31
  54. package/src/lib/styles/css/default.css +1 -0
  55. package/src/lib/styles/css/global.css +1 -0
  56. package/src/lib/styles/css/normalize.css +1 -0
  57. package/src/lib/styles/css/offline.css +1 -0
  58. package/src/lib/styles/css/style.css +1 -0
  59. package/src/lib/styles/fa-global.css +1 -0
  60. package/src/lib/styles/global.min.css +1 -0
  61. package/src/lib/styles/index.js +2 -1
  62. package/src/lib/types/metadata.js +1 -0
  63. package/src/lib/unregisterServiceWorker.js +1 -0
  64. package/src/lib/utils/utm.js +1 -0
  65. package/src/routes/+error.svelte +1 -0
  66. package/src/routes/+layout.js +7 -1
  67. package/src/routes/+layout.svelte +8 -6
  68. package/src/routes/+page.server.js +1 -0
  69. package/src/routes/+page.svelte +1 -0
  70. package/src/routes/about/+page.server.js +1 -0
  71. package/src/routes/about/+page.svelte +1 -0
  72. package/src/routes/api/mock-csp/+server.js +22 -0
  73. package/src/routes/consultation/+page.svelte +1 -0
  74. package/src/routes/contact/+page.svelte +1 -0
  75. package/src/routes/foss-spotlight/+page.server.js +1 -0
  76. package/src/routes/foss-spotlight/+page.svelte +1 -0
  77. package/src/routes/license/+page.server.js +1 -0
  78. package/src/routes/license/+page.svelte +1 -0
  79. package/src/routes/privacy-policy/+page.server.js +1 -0
  80. package/src/routes/privacy-policy/+page.svelte +1 -0
  81. package/src/routes/privacy-rights/+page.svelte +1 -0
  82. package/src/routes/terms-conditions/+page.server.js +1 -0
  83. package/src/routes/terms-conditions/+page.svelte +1 -0
  84. package/src/routes/terms-of-use/+page.server.js +1 -0
  85. package/src/routes/terms-of-use/+page.svelte +1 -0
  86. package/src/service-worker.d.ts +8 -0
  87. package/src/service-worker.js +56 -28
  88. package/static/disableSw.js +12 -0
  89. package/static/docs/Home.md +63 -0
  90. package/static/docs/extensions.md +58 -0
  91. package/static/sitemap.xml +7 -7
  92. package/stylelint.config.js +4 -7
  93. package/svelte.config.js +1 -0
  94. package/tests/e2e/app.spec.js +59 -21
  95. package/tests/e2e/mobile.spec.js +50 -29
  96. package/tests/unit/auditScripts.test.js +1 -0
  97. package/tests/unit/checkEnv.test.js +1 -0
  98. package/tests/unit/checkVersions.test.js +1 -0
  99. package/tests/unit/cspReport.test.js +81 -0
  100. package/tests/unit/demo.test.js +1 -0
  101. package/tests/unit/routes/page.svelte.test.js +1 -0
  102. package/tests/unit/unregisterServiceWorker.test.js +1 -0
  103. package/tests/unit/utm.test.js +1 -0
  104. package/{tsconfig.custom.json → tsconfig.custom.jsonc} +2 -1
  105. package/vite.config.js +1 -0
  106. package/vitest.config.client.js +1 -0
  107. package/vitest.config.server.js +1 -0
  108. package/_headers +0 -9
package/netlify.toml CHANGED
@@ -2,14 +2,23 @@
2
2
  command = "npm run build"
3
3
  publish = "build"
4
4
 
5
+ [build.environment]
6
+ NODE_VERSION = "22"
7
+
8
+ [dev]
9
+ command = "npm run dev"
10
+ targetPort = 5173
11
+ port = 8888
12
+
13
+ [functions."*"]
14
+ node_bundler = "esbuild"
15
+ included_files = ["netlify-functions/**"]
16
+
5
17
  [[plugins]]
6
18
  package = "netlify-plugin-submit-sitemap"
7
19
 
8
- [plugins.inputs]
9
- baseUrl = "https://netwk.pro"
10
- sitemapPath = "/sitemap.xml"
11
- ignorePeriod = 0
12
- providers = [
13
- "google",
14
- "yandex"
15
- ]
20
+ [plugins.inputs]
21
+ baseUrl = "https://netwk.pro"
22
+ sitemapPath = "/sitemap.xml"
23
+ ignorePeriod = 0
24
+ providers = ["google", "yandex"]
package/package.json CHANGED
@@ -1,8 +1,10 @@
1
1
  {
2
2
  "name": "@networkpro/web",
3
3
  "private": false,
4
- "sideEffects": false,
5
- "version": "1.5.2",
4
+ "sideEffects": [
5
+ "./.netlify/shims.js"
6
+ ],
7
+ "version": "1.6.0",
6
8
  "description": "Locking Down Networks, Unlocking Confidence | Security, Networking, Privacy — Network Pro Strategies",
7
9
  "keywords": [
8
10
  "advisory",
@@ -34,63 +36,56 @@
34
36
  "node": ">=22.0.0 <25",
35
37
  "npm": ">=11.0.0 <12"
36
38
  },
37
- "style": "src/lib/styles/global.min.css",
38
- "scripts": {
39
- "dev": "vite dev",
40
- "preview": "vite preview",
41
- "start": "npm run dev",
42
-
43
- "build": "vite build",
44
- "build:netlify": "netlify build",
45
- "css:bundle": "node scripts/bundleCss.js",
46
-
47
- "prepare": "svelte-kit sync || echo ''",
48
- "check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
49
- "check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
50
- "check:env": "node scripts/checkEnv.js",
51
- "check:node": "node scripts/checkNode.js",
52
-
53
- "checkout": "npm run check:node && npm run test:all && npm run lint:all && npm run check && npm run audit:scripts",
54
- "verify": "npm run checkout",
55
-
56
- "delete": "rm -rf build .svelte-kit node_modules package-lock.json",
57
- "clean": "npm run delete && npm cache clean --force && npm install",
58
- "upgrade": "npx npm-check-updates -u",
59
-
60
- "test": "npm run test:all",
61
- "test:all": "npm run test:client -- --run && npm run test:server -- --run",
62
- "test:client": "vitest --config vitest.config.client.js",
63
- "test:server": "vitest --config vitest.config.server.js",
64
- "test:watch": "vitest --config vitest.config.client.js --watch",
65
- "test:coverage": "npm run test:client -- --run --coverage && npm run test:server -- --run --coverage",
66
-
67
- "lint": "eslint . --ext .mjs,.js,.svelte",
68
- "lint:fix": "eslint . --ext .mjs,.js,.svelte --fix",
69
- "lint:jsdoc": "eslint . --ext .js,.mjs,.svelte --max-warnings=0",
70
- "lint:css": "stylelint \"**/*.{css,svelte}\" --ignore-path .stylelintignore",
71
- "lint:md": "npx markdownlint-cli2 \"**/*.{md,markdown}\" \"#node_modules/**\" \"#build/**\"",
72
- "lint:all": "npm run lint && npm run lint:md && npm run lint:css && npm run format",
73
- "format": "prettier --check .",
74
- "format:fix": "prettier --write .",
75
-
76
- "lhci": "lhci",
77
- "lighthouse": "npm run lighthouse:local",
78
- "lighthouse:local": "npm run build && npm run preview & wait-on http://localhost:4173 && npm run lhci:run",
79
- "lhci:run": "lhci autorun --config=.lighthouserc.cjs",
80
-
81
- "audit:scripts": "node scripts/auditScripts.js",
82
- "head:flatten": "node scripts/flattenHeaders.js",
83
- "head:validate": "node scripts/validateHeaders.js",
84
-
85
- "postinstall": "npm run check:node"
86
- },
39
+ "style": "src/lib/styles/index.js",
40
+ "scripts": {
41
+ "dev": "vite dev",
42
+ "start": "npm run dev",
43
+ "dev:netlify": "netlify dev",
44
+ "build": "vite build",
45
+ "preview": "vite preview",
46
+ "build:netlify": "netlify build",
47
+ "css:bundle": "node scripts/bundleCss.js",
48
+ "prepare": "svelte-kit sync || echo ''",
49
+ "check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
50
+ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
51
+ "check:env": "node scripts/checkEnv.js",
52
+ "check:node": "node scripts/checkNode.js",
53
+ "checkout": "npm run check:node && npm run test:all && npm run lint:all && npm run check && npm run audit:scripts",
54
+ "verify": "npm run checkout",
55
+ "delete": "rm -rf build .svelte-kit node_modules package-lock.json",
56
+ "clean": "npm run delete && npm cache clean --force && npm install",
57
+ "upgrade": "npx npm-check-updates -u",
58
+ "test": "npm run test:all",
59
+ "test:all": "npm run test:client -- --run && npm run test:server -- --run",
60
+ "test:client": "vitest --config vitest.config.client.js",
61
+ "test:server": "vitest --config vitest.config.server.js",
62
+ "test:watch": "vitest --config vitest.config.client.js --watch",
63
+ "test:coverage": "npm run test:client -- --run --coverage && npm run test:server -- --run --coverage",
64
+ "lint": "eslint . --ext .mjs,.js,.svelte",
65
+ "lint:fix": "eslint . --ext .mjs,.js,.svelte --fix",
66
+ "lint:jsdoc": "eslint . --ext .js,.mjs,.svelte --max-warnings=0",
67
+ "lint:css": "stylelint \"**/*.{css,svelte}\" --ignore-path .stylelintignore",
68
+ "lint:md": "npx markdownlint-cli2 \"**/*.{md,markdown}\" \"#node_modules/**\" \"#build/**\" \"#.netlify/**\"",
69
+ "lint:all": "npm run lint && npm run lint:md && npm run lint:css && npm run format",
70
+ "format": "prettier --check .",
71
+ "format:fix": "prettier --write .",
72
+ "lhci": "lhci",
73
+ "lhci:run": "lhci autorun --config=.lighthouserc.cjs",
74
+ "audit:scripts": "node scripts/auditScripts.js",
75
+ "head:flatten": "node scripts/flattenHeaders.js",
76
+ "head:validate": "node scripts/validateHeaders.js",
77
+ "postinstall": "npm run check:node"
78
+ },
87
79
  "dependencies": {
88
- "svelte": "5.32.1"
80
+ "nodemailer": "^7.0.3",
81
+ "playwright": "^1.52.0",
82
+ "semver": "^7.7.2",
83
+ "svelte": "5.33.1"
89
84
  },
90
85
  "devDependencies": {
91
86
  "@eslint/compat": "^1.2.9",
92
87
  "@eslint/js": "^9.27.0",
93
- "@netlify/plugin-sitemap": "^0.8.1",
88
+ "@lhci/cli": "^0.14.0",
94
89
  "@playwright/test": "^1.52.0",
95
90
  "@sveltejs/adapter-netlify": "^5.0.2",
96
91
  "@sveltejs/kit": "2.21.1",
@@ -112,10 +107,8 @@
112
107
  "mdsvex": "^0.12.6",
113
108
  "normalize.css": "^8.0.1",
114
109
  "postcss": "^8.5.3",
115
- "postcss-html": "^1.8.0",
116
110
  "prettier": "^3.5.3",
117
111
  "prettier-plugin-svelte": "^3.4.0",
118
- "semver": "^7.7.2",
119
112
  "stylelint": "^16.19.1",
120
113
  "stylelint-config-html": "^1.1.0",
121
114
  "stylelint-config-recommended": "^16.0.0",
@@ -131,6 +124,9 @@
131
124
  "overrides": {
132
125
  "@sveltejs/kit": {
133
126
  "cookie": "^0.7.0"
127
+ },
128
+ "@lhci/cli": {
129
+ "cookie": "^0.7.0"
134
130
  }
135
131
  }
136
132
  }
@@ -1,6 +1,7 @@
1
1
  /* ==========================================================================
2
2
  playwright.config.js
3
3
 
4
+ Copyright © 2025 Network Pro Strategies (Network Pro™)
4
5
  SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
5
6
  This file is part of Network Pro.
6
7
  ========================================================================== */
@@ -32,11 +33,9 @@ export default defineConfig({
32
33
 
33
34
  /* Shared settings for all projects */
34
35
  use: {
35
- /* Base URL to use in actions like `await page.goto('/')`. */
36
- baseURL: "http://localhost:5173",
37
-
38
- /* Collect trace when retrying the failed test. */
36
+ baseURL: "http://localhost:4173?nosw", // Update to use preview server URL
39
37
  trace: "on-first-retry",
38
+ timeout: 60000, // Default action timeout of 60 seconds for each step
40
39
  },
41
40
 
42
41
  /* Configure projects */
@@ -55,12 +54,13 @@ export default defineConfig({
55
54
  ...devices["Desktop Firefox"], // Use default Firefox settings
56
55
  },
57
56
  },
58
- {
59
- name: "webkit",
60
- use: {
61
- ...devices["Desktop Safari"], // Use default WebKit settings
62
- },
63
- },
57
+ // FIXME: Webkit and Safari consistently failing, disabled for now
58
+ // {
59
+ // name: "webkit",
60
+ // use: {
61
+ // ...devices["Desktop Safari"], // Use default WebKit settings
62
+ // },
63
+ // },
64
64
 
65
65
  // Mobile Browsers
66
66
  {
@@ -70,18 +70,20 @@ export default defineConfig({
70
70
  headless: true, // Enable true headless mode
71
71
  },
72
72
  },
73
- {
74
- name: "Mobile Safari",
75
- use: {
76
- ...devices["iPhone 14"], // Use the iPhone 14 device profile
77
- },
78
- },
73
+ // FIXME: Webkit and Safari consistently failing, disabled for now
74
+ // {
75
+ // name: "Mobile Safari",
76
+ // use: {
77
+ // ...devices["iPhone 14"], // Use the iPhone 14 device profile
78
+ // },
79
+ // },
79
80
  ],
80
81
 
81
- /* Run your local dev server before starting the tests */
82
+ /* Run your local preview server before starting the tests */
82
83
  webServer: {
83
- command: "npm run dev",
84
- url: "http://localhost:5173",
84
+ command: "npm run preview", // Use preview server
85
+ url: "http://localhost:4173?nosw", // Match the preview server URL
85
86
  reuseExistingServer: !process.env.CI,
87
+ timeout: 60 * 1000, // wait up to 60 seconds for preview to be ready
86
88
  },
87
89
  });
@@ -1,6 +1,7 @@
1
1
  /* ==========================================================================
2
2
  postcss.config.mjs
3
3
 
4
+ Copyright © 2025 Network Pro Strategies (Network Pro™)
4
5
  SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
5
6
  This file is part of Network Pro.
6
7
  ========================================================================== */
@@ -1,6 +1,7 @@
1
1
  /* ==========================================================================
2
2
  scripts/auditScripts.js
3
3
 
4
+ Copyright © 2025 Network Pro Strategies (Network Pro™)
4
5
  SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
5
6
  This file is part of Network Pro.
6
7
  ========================================================================== */
@@ -1,6 +1,7 @@
1
1
  /* ==========================================================================
2
2
  scripts/bundleCss.js
3
3
 
4
+ Copyright © 2025 Network Pro Strategies (Network Pro™)
4
5
  SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
5
6
  This file is part of Network Pro.
6
7
  ========================================================================== */
@@ -1,6 +1,7 @@
1
1
  /* ==========================================================================
2
2
  scripts/checkEnv.js
3
3
 
4
+ Copyright © 2025 Network Pro Strategies (Network Pro™)
4
5
  SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
5
6
  This file is part of Network Pro.
6
7
  ========================================================================== */
@@ -1,54 +1,81 @@
1
1
  /* ==========================================================================
2
2
  scripts/checkNode.js
3
3
 
4
+ Copyright © 2025 Network Pro Strategies (Network Pro™)
4
5
  SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
5
6
  This file is part of Network Pro.
6
7
  ========================================================================== */
7
8
 
8
9
  /**
9
- * Utility to check Node.js and NPM version
10
+ * Utility to check Node.js and npm version
10
11
  * Ensures the current environment matches the required versions from package.json
11
12
  *
13
+ * Behavior:
14
+ * - During `postinstall`: warns but does not exit
15
+ * - In all other cases (manual run, CI, verify): fails on mismatch
16
+ *
12
17
  * @module scripts/
13
18
  * @author SunDevil311
14
- * @updated 2025-05-20
19
+ * @updated 2025-05-23
15
20
  */
16
21
 
17
22
  import { execSync } from "child_process";
18
23
  import fs from "fs";
19
24
  import path from "path";
20
25
  import semver from "semver";
26
+ import { fileURLToPath } from "url";
27
+
28
+ const __filename = fileURLToPath(import.meta.url);
29
+ const __dirname = path.dirname(__filename);
21
30
 
22
31
  // Load engines from package.json
23
- const pkg = JSON.parse(fs.readFileSync(path.resolve("./package.json"), "utf8"));
32
+ const pkg = JSON.parse(
33
+ fs.readFileSync(path.resolve(__dirname, "../package.json"), "utf8"),
34
+ );
24
35
  const { node: nodeRange, npm: npmRange } = pkg.engines;
25
36
 
26
- // Check Node version
37
+ // Determine if this is running as part of npm's postinstall hook
38
+ const isPostInstall = process.env.npm_lifecycle_event === "postinstall";
39
+
40
+ let hasError = false;
41
+
42
+ // Check Node.js version
27
43
  if (!semver.satisfies(process.version, nodeRange)) {
28
- console.error(
29
- `⚠️ Node version ${process.version} does not match required range: ${nodeRange}`,
30
- );
31
- process.exit(1);
44
+ const msg = `Node.js ${process.version} does not satisfy required range: ${nodeRange}`;
45
+ if (isPostInstall) {
46
+ console.warn(`⚠️ ${msg}`);
47
+ } else {
48
+ console.error(`❌ ${msg}`);
49
+ hasError = true;
50
+ }
32
51
  }
33
52
 
34
- // Check NPM version
35
- let npmVersion;
53
+ // Check npm version
54
+ let npmVersion = null;
36
55
 
37
56
  try {
38
57
  npmVersion = execSync("npm --version").toString().trim();
39
58
  if (!semver.satisfies(npmVersion, npmRange)) {
40
- console.error(
41
- `⚠️ NPM version ${npmVersion} does not match required range: ${npmRange}`,
42
- );
43
- process.exit(1);
59
+ const msg = `npm ${npmVersion} does not satisfy required range: ${npmRange}`;
60
+ if (isPostInstall) {
61
+ console.warn(`⚠️ ${msg}`);
62
+ } else {
63
+ console.error(`❌ ${msg}`);
64
+ hasError = true;
65
+ }
44
66
  }
45
67
  } catch (err) {
46
- console.error("❌ Failed to check NPM version:", err.message);
68
+ console.error("❌ Failed to check npm version:", err.message);
47
69
  process.exit(1);
48
70
  }
49
71
 
50
- if (!process.env.CI || process.env.VERBOSE === "true") {
51
- console.log(
52
- `✅ Node (${process.version}) matches ${nodeRange}, and NPM (${npmVersion}) matches ${npmRange}`,
53
- );
72
+ // Final output
73
+ if (!hasError) {
74
+ if (!process.env.CI || process.env.VERBOSE === "true") {
75
+ console.log(
76
+ `✅ Node (${process.version}) matches ${nodeRange}, and npm (${npmVersion}) matches ${npmRange}`,
77
+ );
78
+ }
79
+ } else {
80
+ process.exit(1);
54
81
  }
@@ -1,6 +1,7 @@
1
1
  /* ==========================================================================
2
2
  scripts/checkVersions.js
3
3
 
4
+ Copyright © 2025 Network Pro Strategies (Network Pro™)
4
5
  SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
5
6
  This file is part of Network Pro.
6
7
  ========================================================================== */
@@ -1,6 +1,7 @@
1
1
  /* ==========================================================================
2
2
  scripts/flattenHeaders.js
3
3
 
4
+ Copyright © 2025 Network Pro Strategies (Network Pro™)
4
5
  SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
5
6
  This file is part of Network Pro.
6
7
  ========================================================================== */
@@ -1,6 +1,7 @@
1
1
  /* ==========================================================================
2
2
  scripts/validateHeaders.js
3
3
 
4
+ Copyright © 2025 Network Pro Strategies (Network Pro™)
4
5
  SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
5
6
  This file is part of Network Pro.
6
7
  ========================================================================== */
package/src/app.d.ts CHANGED
@@ -1,10 +1,22 @@
1
+ /* ==========================================================================
2
+ src/app.d.ts
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
+
1
9
  /// <reference types="svelte" />
2
10
  // See https://svelte.dev/docs/kit/types#app.d.ts
3
11
  // for information about these interfaces
12
+
4
13
  declare global {
5
14
  namespace App {
6
- // interface Error {}
7
- // interface Locals {}
15
+ // Remove nonce from Locals as it is no longer needed
16
+ // interface Locals {
17
+ // nonce: string;
18
+ // }
19
+
8
20
  // interface PageData {}
9
21
  // interface PageState {}
10
22
  // interface Platform {}
@@ -12,4 +24,3 @@ declare global {
12
24
  }
13
25
 
14
26
  export { };
15
-
package/src/app.html CHANGED
@@ -5,6 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
 
7
7
  <!-- =====================================================================
8
+ Copyright © 2025 Network Pro Strategies (Network Pro™)
8
9
  SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
9
10
  This file is part of Network Pro.
10
11
  ====================================================================== -->
@@ -16,11 +17,6 @@
16
17
  content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1" />
17
18
  <meta name="author" content="Network Pro Strategies" />
18
19
 
19
- <!-- CSP for Dev -->
20
- <meta
21
- http-equiv="Content-Security-Policy"
22
- content="default-src 'self'; script-src 'self' 'unsafe-inline' https://snap.licdn.com; style-src 'self' 'unsafe-inline'; img-src 'self' data: https://px.ads.linkedin.com; connect-src 'self' https://px.ads.linkedin.com;" />
23
-
24
20
  <!-- Favicon: Keep only ICO for max compatibility -->
25
21
  <link
26
22
  rel="icon"
@@ -28,9 +24,7 @@
28
24
  sizes="any"
29
25
  type="image/x-icon" />
30
26
 
31
- <!-- Preconnects (placed early to optimize connection time) -->
32
- <link rel="preconnect" href="https://snap.licdn.com" crossorigin />
33
- <link rel="preconnect" href="https://px.ads.linkedin.com" crossorigin />
27
+ <!-- LinkedIn preconnects removed 2025-05-26 by SunDevil311 -->
34
28
 
35
29
  <!-- Preload FontAwesome webfonts -->
36
30
  <link
@@ -55,59 +49,23 @@
55
49
  name="apple-mobile-web-app-status-bar-style"
56
50
  content="black-translucent" />
57
51
 
52
+ <!-- cspell:disable -->
58
53
  <meta
59
54
  name="facebook-domain-verification"
60
55
  content="bx4ham0zkpvzztzu213bhpt76m9siq" />
56
+ <!-- cspell:enable -->
61
57
 
62
58
  <meta name="generator" content="SvelteKit 2.21.1" />
63
59
 
64
- <script>
65
- if (location.search.includes("nosw")) {
66
- window.__DISABLE_SW__ = true;
67
- console.warn("🧪 Service worker disabled via ?nosw flag in URL.");
68
- }
69
- </script>
60
+ <script src="/disableSw.js"></script>
70
61
 
71
62
  %sveltekit.head%
72
63
  </head>
73
64
  <body>
74
65
  <div id="svelte">%sveltekit.body%</div>
75
66
 
76
- <!-- LinkedIn Insight Tag - Added 2025-05-14 10:05:06 by SunDevil311 -->
77
- <!-- Load LinkedIn script only after page content is fully loaded -->
78
- <script type="text/javascript">
79
- // Wait for window load event for optimal performance
80
- window.addEventListener("load", function () {
81
- // LinkedIn Partner ID
82
- window._linkedin_partner_id = "7223748";
83
- window._linkedin_data_partner_ids =
84
- window._linkedin_data_partner_ids || [];
85
- window._linkedin_data_partner_ids.push(window._linkedin_partner_id);
86
-
87
- // Initialize lintrk if not already initialized
88
- if (!window.lintrk) {
89
- window.lintrk = function (a, b) {
90
- window.lintrk.q.push([a, b]);
91
- };
92
- window.lintrk.q = [];
93
- }
67
+ <!-- LinkedIn Insight Tag removed 2025-05-26 by SunDevil311 -->
94
68
 
95
- // Create and insert script element
96
- var s = document.getElementsByTagName("script")[0];
97
- var b = document.createElement("script");
98
- b.type = "text/javascript";
99
- b.async = true;
100
- b.src = "https://snap.licdn.com/li.lms-analytics/insight.min.js";
101
- s.parentNode.insertBefore(b, s);
102
- });
103
- </script>
104
- <noscript>
105
- <img
106
- height="1"
107
- width="1"
108
- style="display: none"
109
- alt=""
110
- src="https://px.ads.linkedin.com/collect/?pid=7223748&fmt=gif" />
111
- </noscript>
69
+ <!-- cspell:ignore preconnects webfonts lintrk -->
112
70
  </body>
113
71
  </html>
package/src/global.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /* ==========================================================================
2
2
  src/global.d.ts
3
3
 
4
+ Copyright © 2025 Network Pro Strategies (Network Pro™)
4
5
  SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
5
6
  This file is part of Network Pro.
6
7
  ========================================================================== */
@@ -1,16 +1,25 @@
1
1
  /* ==========================================================================
2
2
  src/hooks.client.ts
3
3
 
4
+ Copyright © 2025 Network Pro Strategies (Network Pro™)
4
5
  SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
5
6
  This file is part of Network Pro.
6
7
  ========================================================================== */
7
8
 
8
- window.addEventListener("beforeinstallprompt", (e) => {
9
- // Prevent default install prompt
10
- e.preventDefault();
9
+ // Client-only lifecycle hooks
11
10
 
12
- // Re-dispatch as a custom event so your component can respond
13
- window.dispatchEvent(new CustomEvent("pwa-install-available", { detail: e }));
14
- });
11
+ // Optional: Used if you later need client boot logic
12
+ export const init = undefined;
15
13
 
16
- export {};
14
+ /**
15
+ * Client-side error handler for SvelteKit. Captures uncaught errors
16
+ * during client-side navigation or hydration.
17
+ *
18
+ * @param error - The uncaught error object
19
+ */
20
+ export function handleError(error: Error) {
21
+ console.error("[CLIENT] Unhandled error:", error);
22
+
23
+ // Future: send to error reporting service
24
+ // e.g., Sentry.captureException(error);
25
+ }