Skip to content

Commit feb6e8e

Browse files
authored
Merge pull request #202 from Staffbase/copilot/fix-91b7a471-6a36-40a9-b31e-dc9e6f878f9e
chore: update dependencies and fix security vulnerabilities in weather-forecast sample
2 parents f3d956b + 588992a commit feb6e8e

File tree

9 files changed

+1098
-1070
lines changed

9 files changed

+1098
-1070
lines changed

samples/weather-forecast/dev/bootstrap.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class FakeBaseClass extends window.HTMLElement implements BaseBlock {
4747
const { name, value: attribute } = attr;
4848
if (attribute) {
4949
const key = name as keyof T;
50-
acc[key] = fromDataUri<any>(attribute);
50+
acc[key] = fromDataUri<unknown>(attribute) as T[keyof T];
5151
}
5252

5353
return acc;

samples/weather-forecast/package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
"author": "",
1818
"license": "ISC",
1919
"dependencies": {
20-
"@staffbase/widget-sdk": "^3.15.0",
20+
"@staffbase/widget-sdk": "^3.15.5",
2121
"acorn": "^8.15.0",
2222
"axios": "1.12.2",
23-
"date-fns": "^2.23.0",
23+
"date-fns": "^2.30.0",
2424
"dayjs": "1.11.18",
2525
"react": "^18.3.1",
2626
"react-cool-dimensions": "^3.0.1",
@@ -38,9 +38,9 @@
3838
"@babel/preset-typescript": "^7.27.1",
3939
"@emotion/react": "^11.14.0",
4040
"@emotion/styled": "^11.14.1",
41-
"@mui/icons-material": "^6.3.0",
42-
"@mui/material": "^6.3.0",
43-
"@mui/system": "^6.1.4",
41+
"@mui/icons-material": "^6.5.0",
42+
"@mui/material": "^6.5.0",
43+
"@mui/system": "^6.5.0",
4444
"@rjsf/core": "5.24.13",
4545
"@rjsf/mui": "5.24.13",
4646
"@rjsf/utils": "5.24.13",
@@ -52,20 +52,21 @@
5252
"@types/jest": "^29.5.14",
5353
"@types/json-schema": "^7.0.15",
5454
"@types/node": "24.5.2",
55-
"@types/react": "^18.3.12",
56-
"@types/react-dom": "^18.3.1",
55+
"@types/react": "^18.3.24",
56+
"@types/react-dom": "^18.3.7",
5757
"@types/webpack": "5.28.5",
58-
"@typescript-eslint/eslint-plugin": "5.62.0",
59-
"@typescript-eslint/parser": "5.62.0",
58+
"@typescript-eslint/eslint-plugin": "^6.21.0",
59+
"@typescript-eslint/parser": "^6.21.0",
6060
"@ungap/custom-elements": "1.3.0",
6161
"babel-eslint": "10.1.0",
6262
"babel-loader": "^9.2.1",
6363
"copy-webpack-plugin": "^12.0.2",
6464
"core-js": "3.45.1",
65-
"eslint": "8.3.0",
65+
"eslint": "^8.57.1",
6666
"eslint-config-prettier": "10.1.8",
6767
"file-loader": "^6.2.0",
68-
"jest": "27.1.0",
68+
"jest": "^29.7.0",
69+
"jest-environment-jsdom": "^30.1.2",
6970
"jest-json-schema": "^6.1.0",
7071
"js-base64": "3.7.8",
7172
"minimal-polyfills": "2.2.3",
@@ -74,7 +75,6 @@
7475
"ts-loader": "^9.5.4",
7576
"ts-node": "10.9.2",
7677
"typescript": "5.9.2",
77-
"url-loader": "^4.1.1",
7878
"webpack": "^5.101.3",
7979
"webpack-cli": "^6.0.1",
8080
"webpack-dev-server": "^5.2.2",

samples/weather-forecast/src/api/useCity.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const queryClient = new QueryClient({
2424
defaultOptions: { queries: { retry: false } },
2525
});
2626

27-
const wrapper: FunctionComponent = ({ children }) => (
27+
const wrapper: FunctionComponent<{ children: React.ReactNode }> = ({ children }) => (
2828
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
2929
);
3030

samples/weather-forecast/src/api/useWeather.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const queryClient = new QueryClient({
2424
defaultOptions: { queries: { retry: false } },
2525
});
2626

27-
const wrapper: FunctionComponent = ({ children }) => (
27+
const wrapper: FunctionComponent<{ children: React.ReactNode }> = ({ children }) => (
2828
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
2929
);
3030

samples/weather-forecast/src/api/useWeather.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ const getWeather = async ({
9999
} = options;
100100
const params = { appid, lang, units, lat, lon };
101101

102-
if (typeof lat === undefined || typeof lon === undefined) {
102+
if (lat === undefined || lon === undefined) {
103103
return Promise.reject(new Error("Missing coordinates."));
104104
}
105105

samples/weather-forecast/src/components/Card/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import CSS from "csstype";
1717
export interface CardProperties {
1818
color: string;
1919
smallWidth: boolean;
20-
children: any;
20+
children: React.ReactNode;
2121
}
2222

2323
export const Card: FunctionComponent<CardProperties> = (props) => {

samples/weather-forecast/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
},
2020
"typeRoots": ["./typings", "node_modules/@types"]
2121
},
22-
"include": ["src/*"],
22+
"include": ["src/**/*", "dev/**/*"],
2323
"exclude": ["node_modules", "dist"]
2424
}

samples/weather-forecast/webpack.common.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,12 @@ const config: webpack.Configuration = {
2828
},
2929
{
3030
test: /\.svg$/i,
31+
exclude: /weather-forecast\.svg$/,
3132
use: [{ loader: "@svgr/webpack", options: { icon: true } }],
3233
},
3334
{
3435
test: /weather-forecast\.svg$/,
35-
use: [
36-
{
37-
loader: "url-loader",
38-
},
39-
],
36+
type: "asset/inline",
4037
},
4138
],
4239
},

0 commit comments

Comments
 (0)