Skip to content

Commit

Permalink
chore(deps): Upgrade dependencies (#2045)
Browse files Browse the repository at this point in the history
  • Loading branch information
koistya committed Jun 7, 2023
1 parent cfb535e commit a131f50
Show file tree
Hide file tree
Showing 19 changed files with 2,140 additions and 1,369 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ jobs:
- run: yarn prettier --check .
- run: yarn lint
- run: yarn tsc --build

# Test
- run: yarn workspace app test
- run: yarn workspace edge test
- run: yarn test

# Compile
- run: yarn build
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"prettier.prettierPath": ".yarn/sdks/prettier/index.js",
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"vitest.commandLine": "yarn vitest",
"files.exclude": {
"**/.cache": true,
"**/.DS_Store": true,
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarn/sdks/eslint/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint",
"version": "8.36.0-sdk",
"version": "8.42.0-sdk",
"main": "./lib/api.js",
"type": "commonjs"
}
2 changes: 1 addition & 1 deletion .yarn/sdks/prettier/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prettier",
"version": "2.8.4-sdk",
"version": "2.8.8-sdk",
"main": "./index.js",
"type": "commonjs"
}
2 changes: 1 addition & 1 deletion .yarn/sdks/typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typescript",
"version": "5.0.2-sdk",
"version": "5.0.4-sdk",
"main": "./lib/typescript.js",
"type": "commonjs"
}
7 changes: 5 additions & 2 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ nodeLinker: pnp
packageExtensions:
"@miniflare/r2@*":
dependencies:
"@miniflare/core": ^2.12.1
"@miniflare/core": ^2.14.0
"local-pkg@*":
dependencies:
"happy-dom": ^9.20.3

yarnPath: .yarn/releases/yarn-4.0.0-rc.42.cjs
yarnPath: .yarn/releases/yarn-4.0.0-rc.45.cjs
42 changes: 42 additions & 0 deletions app/core/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,48 @@ import {
type SignInOptions,
} from "./firebase.js";

let idTokenPromise: Promise<string | null> | undefined;
let idTokenPromiseResolve:
| ((value: Promise<string> | null) => void)
| undefined;

const unsubscribeIdTokenChanged = auth.onIdTokenChanged((user) => {
if (user) {
idTokenPromise = user.getIdToken();
idTokenPromiseResolve?.(idTokenPromise as Promise<string>);
} else {
idTokenPromise = Promise.resolve(null);
idTokenPromiseResolve?.(null);
}
});

if (import.meta.hot) {
import.meta.hot.dispose(unsubscribeIdTokenChanged);
}

/**
* Returns a JSON Web Token (JWT) used to identify the user. If the user is not
* authenticated, returns `null`. If the token is expired or will expire in the
* next five minutes, refreshes the token and returns a new one.
*/
export async function getIdToken() {
if (!idTokenPromise) {
idTokenPromise = new Promise<string | null>((resolve, reject) => {
const timeout = setTimeout(() => {
reject(new Error("getIdToken() timeout"));
}, 5000);

idTokenPromiseResolve = (value: PromiseLike<string> | null) => {
resolve(value);
clearTimeout(timeout);
idTokenPromiseResolve = undefined;
};
});
}

return await idTokenPromise;
}

export const SignInMethods: SignInMethod[] = [
"google.com",
"apple.com",
Expand Down
31 changes: 16 additions & 15 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,31 @@
"app:deploy": "yarn workspace app deploy"
},
"dependencies": {
"@babel/runtime": "^7.21.0",
"@emotion/react": "^11.10.6",
"@emotion/styled": "^11.10.6",
"@babel/runtime": "^7.22.3",
"@emotion/react": "^11.11.0",
"@emotion/styled": "^11.11.0",
"@mui/icons-material": "^5.11.16",
"@mui/lab": "^5.0.0-alpha.128",
"@mui/material": "^5.12.2",
"firebase": "^9.20.0",
"@mui/lab": "^5.0.0-alpha.133",
"@mui/material": "^5.13.4",
"firebase": "^9.22.1",
"localforage": "^1.10.0",
"notistack": "^3.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.10.0",
"react-router-dom": "^6.12.0",
"recoil": "^0.7.7"
},
"devDependencies": {
"@babel/core": "^7.21.4",
"@emotion/babel-plugin": "^11.10.6",
"@types/node": "^18.16.1",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.1",
"@babel/core": "^7.22.1",
"@emotion/babel-plugin": "^11.11.0",
"@types/node": "^18.16.16",
"@types/react": "^18.2.8",
"@types/react-dom": "^18.2.4",
"@vitejs/plugin-react": "^4.0.0",
"envars": "^0.4.0",
"typescript": "^5.0.4",
"vite": "^4.3.3",
"vitest": "^0.30.1"
"happy-dom": "^9.20.3",
"typescript": "~5.0.4",
"vite": "^4.3.9",
"vitest": "^0.32.0"
}
}
3 changes: 3 additions & 0 deletions app/theme/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ export function useToggleTheme(name?: PaletteMode) {
);
}

/**
* This component makes the `theme` available down the React tree.
*/
export function ThemeProvider(props: {
children: React.ReactNode;
}): JSX.Element {
Expand Down
13 changes: 7 additions & 6 deletions app/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@

import react from "@vitejs/plugin-react";
import envars from "envars";
import { resolve } from "node:path";
import { URL } from "node:url";
import { defineConfig } from "vitest/config";
import { defineProject } from "vitest/config";
import { Config, EnvName } from "./core/config.js";

// The list of supported environments
const envNames: EnvName[] = ["prod", "test", "local"];

// Bootstrap client-side configuration from environment variables
const configs = envNames.map((envName): [EnvName, Config] => {
const env = envars.config({ env: envName, cwd: "../env" });
const envDir = resolve(__dirname, "../env");
const env = envars.config({ env: envName, cwd: envDir });
return [
envName,
{
Expand Down Expand Up @@ -41,7 +43,7 @@ process.env.VITE_CONFIG = JSON.stringify(Object.fromEntries(configs));
* Vite configuration
* https://vitejs.dev/config/
*/
export default defineConfig({
export default defineProject({
cacheDir: `../.cache/vite-app`,

build: {
Expand Down Expand Up @@ -75,8 +77,7 @@ export default defineConfig({
},

test: {
cache: {
dir: "../.cache/vitest-app",
},
...{ cache: { dir: "../.cache/vitest" } },
environment: "happy-dom",
},
});
28 changes: 17 additions & 11 deletions edge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,29 @@
"build": "vite build",
"test": "vitest",
"coverage": "vitest run --coverage",
"deploy": "node ../scripts/wrangler.js publish",
"wrangler": "node ../scripts/wrangler.js"
"deploy": "node ../scripts/wrangler.js deploy",
"wrangler": "node ../scripts/wrangler.js",
"edge:cf": "node ../scripts/wrangler.js",
"edge:tsc": "tsc",
"edge:test": "vitest",
"edge:build": "vite build",
"edge:deploy": "node ../scripts/wrangler.js deploy"
},
"dependencies": {
"@hono/zod-validator": "^0.1.2",
"hono": "^3.1.6",
"jose": "^4.14.3",
"@hono/zod-validator": "^0.1.3",
"hono": "^3.2.4",
"jose": "^4.14.4",
"web-auth-library": "^1.0.3",
"zod": "^3.21.4"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20230404.0",
"@types/node": "^18.16.1",
"@cloudflare/workers-types": "^4.20230518.0",
"@types/node": "^18.16.16",
"happy-dom": "^9.20.3",
"toml": "^3.0.0",
"typescript": "^5.0.4",
"vite": "^4.3.3",
"vitest": "^0.30.1",
"vitest-environment-miniflare": "^2.13.0"
"typescript": "~5.0.4",
"vite": "^4.3.9",
"vitest": "^0.32.0",
"vitest-environment-miniflare": "^2.14.0"
}
}
12 changes: 5 additions & 7 deletions edge/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
/* SPDX-License-Identifier: MIT */

import { resolve } from "node:path";
import { defineConfig } from "vitest/config";
import { defineProject } from "vitest/config";
import { getCloudflareBindings } from "../scripts/utils.js";

export default defineConfig({
export default defineProject({
cacheDir: "../.cache/vite-edge",

// Production build configuration
Expand All @@ -30,16 +30,14 @@ export default defineConfig({
// Unit testing configuration
// https://vitest.dev/config/
test: {
cache: {
dir: "../.cache/vitest-edge",
},
...{ cache: { dir: resolve(__dirname, "../.cache/vitest") } },
deps: {
registerNodeLoader: true,
// ...{ registerNodeLoader: true },
external: ["__STATIC_CONTENT_MANIFEST"],
},
environment: "miniflare",
environmentOptions: {
bindings: getCloudflareBindings(),
bindings: getCloudflareBindings(resolve(__dirname, "wrangler.toml")),
},
},
});
20 changes: 12 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "root",
"version": "0.0.0",
"private": true,
"packageManager": "yarn@4.0.0-rc.42",
"packageManager": "yarn@4.0.0-rc.45",
"type": "module",
"workspaces": [
"app",
Expand All @@ -14,28 +14,32 @@
"update-schema": "node ./scripts/update-schema.js",
"start": "node --experimental-vm-modules ./scripts/start.js",
"lint": "eslint --cache --report-unused-disable-directives .",
"test": "yarn workspaces foreach -ti run test",
"test": "vitest",
"build": "yarn workspaces foreach -ti run build",
"deploy": "yarn workspace edge deploy"
},
"devDependencies": {
"@emotion/eslint-plugin": "^11.10.0",
"@types/eslint": "^8.37.0",
"@typescript-eslint/eslint-plugin": "^5.59.1",
"@typescript-eslint/parser": "^5.59.1",
"eslint": "^8.39.0",
"@emotion/babel-plugin": "^11.11.0",
"@emotion/eslint-plugin": "^11.11.0",
"@types/eslint": "^8.40.0",
"@typescript-eslint/eslint-plugin": "^5.59.9",
"@typescript-eslint/parser": "^5.59.9",
"eslint": "^8.42.0",
"eslint-config-prettier": "^8.8.0",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"graphql": "^16.6.0",
"happy-dom": "^9.20.3",
"husky": "^8.0.3",
"prettier": "^2.8.8",
"react": "^18.2.0",
"relay-config": "^12.0.1",
"typescript": "^5.0.4"
"typescript": "~5.0.4",
"vite": "^4.3.9",
"vitest": "^0.32.0"
},
"prettier": {
"printWidth": 80,
Expand Down
12 changes: 6 additions & 6 deletions scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
"dependencies": {
"envars": "^0.4.0",
"execa": "^7.1.1",
"get-port": "^6.1.2",
"got": "^12.6.0",
"get-port": "^7.0.0",
"got": "^13.0.0",
"graphql": "^16.6.0",
"lodash-es": "^4.17.21",
"miniflare": "^2.13.0",
"miniflare": "^2.14.0",
"prettier": "^2.8.8",
"toml": "^3.0.0",
"vite": "^4.3.3",
"wrangler": "^2.17.0",
"zx": "^7.2.1"
"vite": "^4.3.9",
"wrangler": "^3.1.0",
"zx": "^7.2.2"
}
}
2 changes: 1 addition & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
/* Modules */
"module": "ESNext", /* Specify what module code is generated. */
// "rootDir": "./", /* Specify the root folder within your source files. */
"moduleResolution": "nodenext", /* Specify how TypeScript looks up a file from a given module specifier. */
"moduleResolution": "bundler", /* Specify how TypeScript looks up a file from a given module specifier. */
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
Expand Down
17 changes: 17 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* SPDX-FileCopyrightText: 2014-present Kriasoft */
/* SPDX-License-Identifier: MIT */

import { defineConfig } from "vitest/config";

/**
* Vitest configuration.
*
* @see https://vitest.dev/config/
*/
export default defineConfig({
test: {
cache: {
dir: "./.cache/vitest",
},
},
});
Loading

0 comments on commit a131f50

Please sign in to comment.