Skip to content

Commit 99795ae

Browse files
committed
major package bumps + script to update lockfiles
1 parent fe4a69e commit 99795ae

File tree

4 files changed

+107
-0
lines changed

4 files changed

+107
-0
lines changed

client/eslint.config.mjs

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import { defineConfig, globalIgnores } from "eslint/config";
2+
import { fixupConfigRules } from "@eslint/compat";
3+
import reactRefresh from "eslint-plugin-react-refresh";
4+
import globals from "globals";
5+
import tsParser from "@typescript-eslint/parser";
6+
import path from "node:path";
7+
import { fileURLToPath } from "node:url";
8+
import js from "@eslint/js";
9+
import { FlatCompat } from "@eslint/eslintrc";
10+
11+
const __filename = fileURLToPath(import.meta.url);
12+
const __dirname = path.dirname(__filename);
13+
const compat = new FlatCompat({
14+
baseDirectory: __dirname,
15+
recommendedConfig: js.configs.recommended,
16+
allConfig: js.configs.all
17+
});
18+
19+
export default defineConfig([globalIgnores(["**/dist", "**/.eslintrc.cjs"]), {
20+
extends: fixupConfigRules(compat.extends(
21+
"eslint:recommended",
22+
"plugin:@typescript-eslint/recommended",
23+
"plugin:react/recommended",
24+
"plugin:react/jsx-runtime",
25+
"plugin:react-hooks/recommended",
26+
"prettier",
27+
)),
28+
settings: {
29+
react: {
30+
version: "detect",
31+
}
32+
},
33+
plugins: {
34+
"react-refresh": reactRefresh,
35+
},
36+
37+
languageOptions: {
38+
globals: {
39+
...globals.browser,
40+
},
41+
42+
parser: tsParser,
43+
},
44+
45+
rules: {
46+
"react-refresh/only-export-components": ["warn", {
47+
allowConstantExport: true,
48+
}],
49+
},
50+
}]);
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { ReactNode, useState } from 'react'
2+
import { User } from 'src/hooks/useAuth'
3+
import { AuthorizationContext } from './AuthorizationContext'
4+
5+
type ProviderType = ({ children }: { children: ReactNode }) => JSX.Element
6+
type ReactChildrenType = { children: ReactNode }
7+
8+
export const AuthorizationProvider: ProviderType = ({
9+
children,
10+
}: ReactChildrenType) => {
11+
const [user, setUser] = useState<User | null>(null)
12+
return (
13+
<AuthorizationContext.Provider value={{ user, setUser }}>
14+
{children}
15+
</AuthorizationContext.Provider>
16+
)
17+
}

client/src/context/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { AuthorizationContext } from './AuthorizationContext'
2+
export { AuthorizationProvider } from './AuthorizationContextProvider'

scripts/update-lockfiles.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
3+
# Navigate to the subgraphs folder
4+
cd subgraphs || { echo "Subgraphs folder not found"; exit 1; }
5+
6+
# Loop through all subfolders
7+
for dir in */; do
8+
if [ -d "$dir" ]; then
9+
# Check if the directory contains a package.json file
10+
if [ ! -f "$dir/package.json" ]; then
11+
echo "No package.json found in $dir, skipping."
12+
continue
13+
fi
14+
15+
echo "Processing $dir"
16+
cd "$dir" || continue
17+
# Run npm install with the specified flags
18+
npm i --package-lock-only --workspaces=false
19+
volta pin node@22
20+
cd ..
21+
fi
22+
done
23+
24+
echo "Done processing all subgraphs, now processing client."
25+
26+
# Navigate to the client folder
27+
cd ../client || { echo "Client folder not found"; exit 1; }
28+
npm i --package-lock-only --workspaces=false
29+
volta pin node@22
30+
31+
echo "Done processing client."
32+
33+
# Navigate to the coprocessor folder
34+
cd ../coprocessor || { echo "Coprocessor folder not found"; exit 1; }
35+
npm i --package-lock-only --workspaces=false
36+
volta pin node@22
37+
38+
echo "Done processing coprocessor."

0 commit comments

Comments
 (0)