Skip to content

Commit

Permalink
Merge pull request #2030 from trilitech/add-subresource-integrity-to-web
Browse files Browse the repository at this point in the history
Add subresource integrity
  • Loading branch information
asiia-trilitech authored Nov 5, 2024
2 parents 8c8e472 + 9968222 commit 4e0fdc1
Show file tree
Hide file tree
Showing 13 changed files with 145 additions and 182 deletions.
1 change: 1 addition & 0 deletions apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
"vite": "^5.4.8",
"vite-plugin-checker": "^0.8.0",
"vite-plugin-node-polyfills": "^0.17.0",
"vite-plugin-sri": "^0.0.2",
"zod": "^3.23.8",
"@hookform/resolvers": "^3.9.0"
},
Expand Down
2 changes: 2 additions & 0 deletions apps/desktop/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import react from "@vitejs/plugin-react";
import { defineConfig, loadEnv } from "vite";
import { checker } from "vite-plugin-checker";
import { nodePolyfills } from "vite-plugin-node-polyfills";
import sri from "vite-plugin-sri";

// eslint-disable-next-line import/no-unused-modules
export default ({ mode }: { mode: "development" | "production" }) => {
Expand Down Expand Up @@ -39,6 +40,7 @@ export default ({ mode }: { mode: "development" | "production" }) => {
useFlatConfig: false,
},
}),
sri({ algorithm: "sha384" }),
].filter(Boolean),
build: {
outDir: "build",
Expand Down
1 change: 1 addition & 0 deletions apps/embed-iframe-mainnet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"typescript": "5.5.4",
"vite": "^5.4.8",
"vite-plugin-node-polyfills": "^0.17.0",
"vite-plugin-sri": "^0.0.2",
"vite-plugin-svgr": "^4.2.0"
}
}
3 changes: 3 additions & 0 deletions apps/embed-iframe-mainnet/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/// <reference path="../../../global.d.ts" />
/// <reference types="vite/client" />
/// <reference types="vite-plugin-svgr/client" />
2 changes: 2 additions & 0 deletions apps/embed-iframe-mainnet/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { defineConfig } from "vite";
import { nodePolyfills } from "vite-plugin-node-polyfills";
import svgr from "vite-plugin-svgr";
import path from "path";
import sri from "vite-plugin-sri";

export default defineConfig({
base: "./",
Expand All @@ -15,6 +16,7 @@ export default defineConfig({
Buffer: true,
},
}),
sri({ algorithm: "sha384" }),
],
optimizeDeps: {
esbuildOptions: {
Expand Down
1 change: 1 addition & 0 deletions apps/embed-iframe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"typescript": "5.5.4",
"vite": "^5.4.8",
"vite-plugin-node-polyfills": "^0.17.0",
"vite-plugin-sri": "^0.0.2",
"vite-plugin-svgr": "^4.2.0"
}
}
3 changes: 3 additions & 0 deletions apps/embed-iframe/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/// <reference path="../../../global.d.ts" />
/// <reference types="vite/client" />
/// <reference types="vite-plugin-svgr/client" />
2 changes: 2 additions & 0 deletions apps/embed-iframe/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import { nodePolyfills } from "vite-plugin-node-polyfills";
import svgr from "vite-plugin-svgr";
import sri from "vite-plugin-sri";

export default defineConfig({
base: "./",
Expand All @@ -14,6 +15,7 @@ export default defineConfig({
Buffer: true,
},
}),
sri({ algorithm: "sha384" }),
],
optimizeDeps: {
esbuildOptions: {
Expand Down
1 change: 1 addition & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
"typescript": "^5.5.4",
"vite": "^5.4.8",
"vite-plugin-node-polyfills": "^0.17.0",
"vite-plugin-sri": "^0.0.2",
"vite-plugin-svgr": "^4.2.0"
},
"packageManager": "[email protected]"
Expand Down
2 changes: 2 additions & 0 deletions apps/web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import { nodePolyfills } from "vite-plugin-node-polyfills";
import svgr from "vite-plugin-svgr";
import sri from "vite-plugin-sri";

// https://vitejs.dev/config/
export default defineConfig({
Expand Down Expand Up @@ -32,6 +33,7 @@ export default defineConfig({
Buffer: true,
},
}),
sri({ algorithm: "sha384" }),
],
build: {
emptyOutDir: false,
Expand Down
2 changes: 2 additions & 0 deletions global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ declare namespace NodeJS {
readonly PUBLIC_URL: string;
}
}

declare module 'vite-plugin-sri';
2 changes: 1 addition & 1 deletion packages/typescript-config/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"customConditions": ["@umami/source"]
"customConditions": ["@umami/source"],
}
}
Loading

3 comments on commit 4e0fdc1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Title Lines Statements Branches Functions
apps/desktop Coverage: 84%
83.87% (1763/2102) 79.33% (837/1055) 78.42% (447/570)
apps/web Coverage: 84%
83.87% (1763/2102) 79.33% (837/1055) 78.42% (447/570)
packages/components Coverage: 97%
97.84% (182/186) 96.51% (83/86) 87.03% (47/54)
packages/core Coverage: 81%
82.22% (222/270) 71.73% (99/138) 81.96% (50/61)
packages/crypto Coverage: 100%
100% (43/43) 90.9% (10/11) 100% (7/7)
packages/data-polling Coverage: 97%
95.27% (141/148) 87.5% (21/24) 92.85% (39/42)
packages/multisig Coverage: 98%
98.47% (129/131) 85.71% (18/21) 100% (35/35)
packages/social-auth Coverage: 100%
100% (21/21) 100% (11/11) 100% (3/3)
packages/state Coverage: 85%
84.71% (798/942) 81.33% (170/209) 78.77% (297/377)
packages/tezos Coverage: 86%
85.57% (89/104) 89.47% (17/19) 82.75% (24/29)
packages/tzkt Coverage: 86%
84.05% (58/69) 81.25% (13/16) 76.92% (30/39)

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Title Lines Statements Branches Functions
apps/desktop Coverage: 84%
83.87% (1763/2102) 79.33% (837/1055) 78.42% (447/570)
apps/web Coverage: 84%
83.87% (1763/2102) 79.33% (837/1055) 78.42% (447/570)
packages/components Coverage: 97%
97.84% (182/186) 96.51% (83/86) 87.03% (47/54)
packages/core Coverage: 81%
82.22% (222/270) 71.73% (99/138) 81.96% (50/61)
packages/crypto Coverage: 100%
100% (43/43) 90.9% (10/11) 100% (7/7)
packages/data-polling Coverage: 97%
95.27% (141/148) 87.5% (21/24) 92.85% (39/42)
packages/multisig Coverage: 98%
98.47% (129/131) 85.71% (18/21) 100% (35/35)
packages/social-auth Coverage: 100%
100% (21/21) 100% (11/11) 100% (3/3)
packages/state Coverage: 85%
84.71% (798/942) 81.33% (170/209) 78.77% (297/377)
packages/tezos Coverage: 86%
85.57% (89/104) 89.47% (17/19) 82.75% (24/29)
packages/tzkt Coverage: 86%
84.05% (58/69) 81.25% (13/16) 76.92% (30/39)

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Title Lines Statements Branches Functions
apps/desktop Coverage: 84%
83.87% (1763/2102) 79.33% (837/1055) 78.42% (447/570)
apps/web Coverage: 84%
83.87% (1763/2102) 79.33% (837/1055) 78.42% (447/570)
packages/components Coverage: 97%
97.84% (182/186) 96.51% (83/86) 87.03% (47/54)
packages/core Coverage: 81%
82.22% (222/270) 71.73% (99/138) 81.96% (50/61)
packages/crypto Coverage: 100%
100% (43/43) 90.9% (10/11) 100% (7/7)
packages/data-polling Coverage: 97%
95.27% (141/148) 87.5% (21/24) 92.85% (39/42)
packages/multisig Coverage: 98%
98.47% (129/131) 85.71% (18/21) 100% (35/35)
packages/social-auth Coverage: 100%
100% (21/21) 100% (11/11) 100% (3/3)
packages/state Coverage: 85%
84.71% (798/942) 81.33% (170/209) 78.77% (297/377)
packages/tezos Coverage: 86%
85.57% (89/104) 89.47% (17/19) 82.75% (24/29)
packages/tzkt Coverage: 86%
84.05% (58/69) 81.25% (13/16) 76.92% (30/39)

Please sign in to comment.