@networkpro/web 1.12.8 → 1.13.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.
- package/CHANGELOG.md +64 -1
- package/README.md +8 -8
- package/cspell.json +1 -0
- package/eslint.config.mjs +48 -48
- package/jsconfig.template.jsonc +3 -1
- package/netlify/edge-functions/csp-report.js +31 -31
- package/package.json +6 -6
- package/playwright.config.js +14 -14
- package/postcss.config.mjs +1 -1
- package/scripts/auditScripts.js +16 -16
- package/scripts/bundleCss.js +5 -5
- package/scripts/checkEnv.js +6 -6
- package/scripts/checkNode.js +10 -10
- package/scripts/checkVersions.js +6 -6
- package/scripts/flattenHeaders.js +13 -13
- package/scripts/generateTest.js +5 -5
- package/scripts/openReport.js +3 -3
- package/scripts/validateHeaders.js +13 -13
- package/src/hooks.client.ts +1 -1
- package/src/hooks.server.js +31 -31
- package/src/lib/components/Badges.svelte +9 -9
- package/src/lib/components/CodeBlock.svelte +13 -0
- package/src/lib/components/ContainerSection.svelte +1 -1
- package/src/lib/components/FullWidthSection.svelte +3 -3
- package/src/lib/components/LegalNav.svelte +6 -6
- package/src/lib/components/Logo.svelte +9 -9
- package/src/lib/components/MetaTags.svelte +3 -3
- package/src/lib/components/PWAInstallButton.svelte +4 -4
- package/src/lib/components/RedirectPage.svelte +4 -4
- package/src/lib/components/SocialMedia.svelte +16 -16
- package/src/lib/components/foss/FossItemContent.svelte +18 -18
- package/src/lib/components/layout/Footer.svelte +17 -17
- package/src/lib/components/layout/HeaderDefault.svelte +16 -16
- package/src/lib/components/layout/HeaderHome.svelte +14 -14
- package/src/lib/images.js +34 -34
- package/src/lib/index.js +15 -15
- package/src/lib/meta.js +29 -29
- package/src/lib/pages/AboutContent.svelte +24 -24
- package/src/lib/pages/FossContent.svelte +12 -12
- package/src/lib/pages/HomeContent.svelte +6 -6
- package/src/lib/pages/LicenseContent.svelte +38 -38
- package/src/lib/pages/PGPContent.svelte +61 -29
- package/src/lib/pages/PrivacyContent.svelte +39 -39
- package/src/lib/pages/PrivacyDashboard.svelte +12 -12
- package/src/lib/pages/TermsConditionsContent.svelte +28 -28
- package/src/lib/pages/TermsUseContent.svelte +26 -26
- package/src/lib/registerServiceWorker.js +25 -25
- package/src/lib/stores/posthog.js +13 -13
- package/src/lib/stores/trackingPreferences.js +19 -19
- package/src/lib/styles/css/default.css +5 -1
- package/src/lib/styles/global.min.css +1 -1
- package/src/lib/unregisterServiceWorker.js +1 -1
- package/src/lib/utils/purify.js +4 -4
- package/src/lib/utils/utm.js +2 -2
- package/src/routes/+error.svelte +4 -4
- package/src/routes/+layout.js +6 -6
- package/src/routes/+layout.svelte +29 -29
- package/src/routes/+page.server.js +2 -2
- package/src/routes/+page.svelte +9 -9
- package/src/routes/about/+page.server.js +2 -2
- package/src/routes/about/+page.svelte +7 -7
- package/src/routes/api/mock-csp/+server.js +3 -3
- package/src/routes/consultation/+page.svelte +5 -5
- package/src/routes/contact/+page.svelte +5 -5
- package/src/routes/foss-spotlight/+page.server.js +2 -2
- package/src/routes/foss-spotlight/+page.svelte +7 -7
- package/src/routes/license/+page.server.js +2 -2
- package/src/routes/license/+page.svelte +7 -7
- package/src/routes/pgp/+page.server.js +2 -2
- package/src/routes/pgp/+page.svelte +7 -7
- package/src/routes/pgp/[key]/+server.js +9 -9
- package/src/routes/privacy/+page.server.js +2 -2
- package/src/routes/privacy/+page.svelte +7 -7
- package/src/routes/privacy-dashboard/+page.server.js +2 -2
- package/src/routes/privacy-dashboard/+page.svelte +8 -8
- package/src/routes/privacy-rights/+page.svelte +5 -5
- package/src/routes/status/+page.server.js +2 -2
- package/src/routes/terms-conditions/+page.server.js +2 -2
- package/src/routes/terms-conditions/+page.svelte +7 -7
- package/src/routes/terms-of-use/+page.server.js +2 -2
- package/src/routes/terms-of-use/+page.svelte +7 -7
- package/src/service-worker.js +86 -85
- package/static/disableSw.js +2 -2
- package/static/img/powered-by-proton.svg +1 -0
- package/static/offline.html +7 -7
- package/static/sitemap.xml +64 -4
- package/stylelint.config.js +56 -56
- package/svelte.config.js +6 -6
- package/tests/e2e/app.spec.js +25 -25
- package/tests/e2e/mobile.spec.js +18 -18
- package/tests/e2e/shared/helpers.js +4 -4
- package/tests/internal/auditCoverage.test.js +24 -24
- package/tests/unit/checkEnv.test.js +10 -10
- package/tests/unit/checkVersions.test.js +4 -4
- package/tests/unit/csp-report.test.js +24 -24
- package/tests/unit/demo.test.js +3 -3
- package/tests/unit/lib/utils/purify.test.js +12 -12
- package/tests/unit/routes/page.svelte.test.js +10 -10
- package/tests/unit/unregisterServiceWorker.test.js +5 -5
- package/tests/unit/utm.test.js +13 -13
- package/vite.config.js +5 -5
- package/vitest-setup-client.js +4 -4
- package/vitest.config.client.js +15 -15
- package/vitest.config.server.js +13 -13
|
@@ -6,16 +6,16 @@ SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
|
|
|
6
6
|
This file is part of Network Pro.
|
|
7
7
|
========================================================================== */
|
|
8
8
|
|
|
9
|
-
import { beforeEach, describe, expect, it, vi } from
|
|
10
|
-
import { unregisterServiceWorker } from
|
|
9
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
10
|
+
import { unregisterServiceWorker } from '../../src/lib/unregisterServiceWorker.js';
|
|
11
11
|
|
|
12
|
-
describe(
|
|
12
|
+
describe('unregisterServiceWorker()', () => {
|
|
13
13
|
beforeEach(() => {
|
|
14
14
|
// Clean up any mocks from previous runs
|
|
15
15
|
vi.restoreAllMocks();
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
it(
|
|
18
|
+
it('should call unregister on all registered service workers', async () => {
|
|
19
19
|
const mockUnregister1 = vi.fn();
|
|
20
20
|
const mockUnregister2 = vi.fn();
|
|
21
21
|
|
|
@@ -24,7 +24,7 @@ describe("unregisterServiceWorker()", () => {
|
|
|
24
24
|
const mockRegistration2 = { unregister: mockUnregister2 };
|
|
25
25
|
|
|
26
26
|
// Stub getRegistrations to return mock service workers
|
|
27
|
-
Object.defineProperty(navigator,
|
|
27
|
+
Object.defineProperty(navigator, 'serviceWorker', {
|
|
28
28
|
configurable: true,
|
|
29
29
|
value: {
|
|
30
30
|
getRegistrations: vi
|
package/tests/unit/utm.test.js
CHANGED
|
@@ -6,44 +6,44 @@ SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
|
|
|
6
6
|
This file is part of Network Pro.
|
|
7
7
|
========================================================================== */
|
|
8
8
|
|
|
9
|
-
import { appendUTM } from
|
|
10
|
-
import { afterEach, describe, expect, it } from
|
|
9
|
+
import { appendUTM } from '$lib/utils/utm.js';
|
|
10
|
+
import { afterEach, describe, expect, it } from 'vitest';
|
|
11
11
|
|
|
12
|
-
describe(
|
|
12
|
+
describe('appendUTM', () => {
|
|
13
13
|
const originalWindow = globalThis.window;
|
|
14
14
|
|
|
15
15
|
afterEach(() => {
|
|
16
16
|
globalThis.window = originalWindow;
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
-
it(
|
|
19
|
+
it('should return null when not in a browser environment', () => {
|
|
20
20
|
// @ts-expect-error – simulating SSR
|
|
21
21
|
delete globalThis.window;
|
|
22
22
|
|
|
23
|
-
const url =
|
|
23
|
+
const url = 'https://example.com';
|
|
24
24
|
const result = appendUTM(url);
|
|
25
25
|
expect(result).toBe(null);
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
-
it(
|
|
28
|
+
it('should return URL with utm_source appended', () => {
|
|
29
29
|
globalThis.window = {
|
|
30
30
|
// @ts-expect-error – mock minimal window for test
|
|
31
|
-
location: { search:
|
|
31
|
+
location: { search: '?utm_source=linkedin' },
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
const url =
|
|
34
|
+
const url = 'https://example.com';
|
|
35
35
|
const result = appendUTM(url);
|
|
36
|
-
expect(result).toBe(
|
|
36
|
+
expect(result).toBe('https://example.com?utm_source=linkedin');
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
-
it(
|
|
39
|
+
it('should return original URL if no utm_source is present', () => {
|
|
40
40
|
globalThis.window = {
|
|
41
41
|
// @ts-expect-error – mock minimal window for test
|
|
42
|
-
location: { search:
|
|
42
|
+
location: { search: '' },
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
const url =
|
|
45
|
+
const url = 'https://example.com';
|
|
46
46
|
const result = appendUTM(url);
|
|
47
|
-
expect(result).toBe(
|
|
47
|
+
expect(result).toBe('https://example.com');
|
|
48
48
|
});
|
|
49
49
|
});
|
package/vite.config.js
CHANGED
|
@@ -6,17 +6,17 @@ SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
|
|
|
6
6
|
This file is part of Network Pro.
|
|
7
7
|
========================================================================= */
|
|
8
8
|
|
|
9
|
-
import { sveltekit } from
|
|
10
|
-
import { defineConfig } from
|
|
11
|
-
import lightningcssPlugin from
|
|
12
|
-
import tsconfigPaths from
|
|
9
|
+
import { sveltekit } from '@sveltejs/kit/vite';
|
|
10
|
+
import { defineConfig } from 'vite';
|
|
11
|
+
import lightningcssPlugin from 'vite-plugin-lightningcss';
|
|
12
|
+
import tsconfigPaths from 'vite-tsconfig-paths'; // NEW: tsconfig/jsconfig alias support
|
|
13
13
|
|
|
14
14
|
export default defineConfig({
|
|
15
15
|
plugins: [
|
|
16
16
|
tsconfigPaths(), // Insert before sveltekit()
|
|
17
17
|
sveltekit(),
|
|
18
18
|
lightningcssPlugin({
|
|
19
|
-
minify: process.env.NODE_ENV ===
|
|
19
|
+
minify: process.env.NODE_ENV === 'production',
|
|
20
20
|
pruneUnusedFontFaceRules: true,
|
|
21
21
|
pruneUnusedKeyframes: true,
|
|
22
22
|
removeUnusedFontFaces: true,
|
package/vitest-setup-client.js
CHANGED
|
@@ -7,12 +7,12 @@ This file is part of Network Pro.
|
|
|
7
7
|
|
|
8
8
|
/* eslint-env vitest */
|
|
9
9
|
|
|
10
|
-
import
|
|
11
|
-
import { cleanup } from
|
|
12
|
-
import { afterEach, vi } from
|
|
10
|
+
import '@testing-library/jest-dom/vitest';
|
|
11
|
+
import { cleanup } from '@testing-library/svelte';
|
|
12
|
+
import { afterEach, vi } from 'vitest';
|
|
13
13
|
|
|
14
14
|
// required for svelte5 + jsdom as jsdom does not support matchMedia
|
|
15
|
-
Object.defineProperty(window,
|
|
15
|
+
Object.defineProperty(window, 'matchMedia', {
|
|
16
16
|
writable: true,
|
|
17
17
|
enumerable: true,
|
|
18
18
|
value: vi.fn().mockImplementation((query) => ({
|
package/vitest.config.client.js
CHANGED
|
@@ -6,41 +6,41 @@ SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
|
|
|
6
6
|
This file is part of Network Pro.
|
|
7
7
|
========================================================================= */
|
|
8
8
|
|
|
9
|
-
import { sveltekit } from
|
|
10
|
-
import { svelteTesting } from
|
|
11
|
-
import lightningcssPlugin from
|
|
12
|
-
import { defineConfig } from
|
|
9
|
+
import { sveltekit } from '@sveltejs/kit/vite';
|
|
10
|
+
import { svelteTesting } from '@testing-library/svelte/vite';
|
|
11
|
+
import lightningcssPlugin from 'vite-plugin-lightningcss';
|
|
12
|
+
import { defineConfig } from 'vitest/config';
|
|
13
13
|
|
|
14
14
|
export default defineConfig({
|
|
15
15
|
plugins: [
|
|
16
16
|
sveltekit(),
|
|
17
17
|
svelteTesting(),
|
|
18
18
|
lightningcssPlugin({
|
|
19
|
-
minify: process.env.NODE_ENV ===
|
|
19
|
+
minify: process.env.NODE_ENV === 'production',
|
|
20
20
|
pruneUnusedFontFaceRules: true,
|
|
21
21
|
pruneUnusedKeyframes: true,
|
|
22
22
|
removeUnusedFontFaces: true,
|
|
23
23
|
}),
|
|
24
24
|
],
|
|
25
25
|
test: {
|
|
26
|
-
name:
|
|
27
|
-
environment:
|
|
26
|
+
name: 'client',
|
|
27
|
+
environment: 'jsdom',
|
|
28
28
|
clearMocks: true,
|
|
29
29
|
include: [
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
'tests/unit/**/*.test.{js,mjs,svelte}',
|
|
31
|
+
'tests/internal/**/*.test.{js,mjs,svelte}',
|
|
32
32
|
],
|
|
33
33
|
exclude: [],
|
|
34
|
-
setupFiles: [
|
|
35
|
-
reporters: [
|
|
34
|
+
setupFiles: ['./vitest-setup-client.js'],
|
|
35
|
+
reporters: ['default', 'json'],
|
|
36
36
|
testTimeout: 10000,
|
|
37
37
|
outputFile: {
|
|
38
|
-
json:
|
|
38
|
+
json: './reports/client/results.json',
|
|
39
39
|
},
|
|
40
40
|
coverage: {
|
|
41
|
-
provider:
|
|
42
|
-
reporter: [
|
|
43
|
-
reportsDirectory:
|
|
41
|
+
provider: 'v8',
|
|
42
|
+
reporter: ['html'],
|
|
43
|
+
reportsDirectory: './reports/client/coverage',
|
|
44
44
|
},
|
|
45
45
|
},
|
|
46
46
|
});
|
package/vitest.config.server.js
CHANGED
|
@@ -6,34 +6,34 @@ SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
|
|
|
6
6
|
This file is part of Network Pro.
|
|
7
7
|
========================================================================= */
|
|
8
8
|
|
|
9
|
-
import { sveltekit } from
|
|
10
|
-
import lightningcssPlugin from
|
|
11
|
-
import { defineConfig } from
|
|
9
|
+
import { sveltekit } from '@sveltejs/kit/vite';
|
|
10
|
+
import lightningcssPlugin from 'vite-plugin-lightningcss';
|
|
11
|
+
import { defineConfig } from 'vitest/config';
|
|
12
12
|
|
|
13
13
|
export default defineConfig({
|
|
14
14
|
plugins: [
|
|
15
15
|
sveltekit(),
|
|
16
16
|
lightningcssPlugin({
|
|
17
|
-
minify: process.env.NODE_ENV ===
|
|
17
|
+
minify: process.env.NODE_ENV === 'production',
|
|
18
18
|
pruneUnusedFontFaceRules: true,
|
|
19
19
|
pruneUnusedKeyframes: true,
|
|
20
20
|
removeUnusedFontFaces: true,
|
|
21
21
|
}),
|
|
22
22
|
],
|
|
23
23
|
test: {
|
|
24
|
-
name:
|
|
25
|
-
environment:
|
|
26
|
-
include: [
|
|
27
|
-
exclude: [
|
|
28
|
-
reporters: [
|
|
24
|
+
name: 'server',
|
|
25
|
+
environment: 'node',
|
|
26
|
+
include: ['tests/unit/**/*.test.{js,mjs}'],
|
|
27
|
+
exclude: ['tests/unit/**/*.svelte.test.{js,mjs}'],
|
|
28
|
+
reporters: ['default', 'json'],
|
|
29
29
|
testTimeout: 10000,
|
|
30
30
|
outputFile: {
|
|
31
|
-
json:
|
|
31
|
+
json: './reports/server/results.json',
|
|
32
32
|
},
|
|
33
33
|
coverage: {
|
|
34
|
-
provider:
|
|
35
|
-
reporter: [
|
|
36
|
-
reportsDirectory:
|
|
34
|
+
provider: 'v8',
|
|
35
|
+
reporter: ['html'],
|
|
36
|
+
reportsDirectory: './reports/server/coverage',
|
|
37
37
|
},
|
|
38
38
|
},
|
|
39
39
|
});
|