-
Notifications
You must be signed in to change notification settings - Fork 8
[WIP] feat(TS builds): move off vite for builds and use updated tsconfig instead #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ export const AddUser: React.FC = () => { | |
name: newUserName, | ||
age: 30, | ||
email: '[email protected]', | ||
badge: { name: 'new user' }, | ||
}); | ||
setNewUserName(''); | ||
}} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
// biome-ignore lint/suspicious/noExplicitAny: <explanation> | ||
export const serialize = (data: any) => { | ||
return JSON.stringify(data, (key, value) => { | ||
return JSON.stringify(data, (_key, value) => { | ||
if (value instanceof Uint8Array) { | ||
return { type: 'Uint8Array', data: Array.from(value) }; | ||
Comment on lines
+3
to
5
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤮🤮🤮🤮 |
||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,10 +10,9 @@ const Login = () => { | |
|
||
const connectWallet = async () => { | ||
let newSigner = null; | ||
let provider; | ||
let provider: ethers.AbstractProvider | ethers.BrowserProvider; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we use Viem instead of Ethers? https://github.com/wevm/viem |
||
|
||
try { | ||
// @ts-expect-error ethereum is defined in the browser | ||
if (window.ethereum == null) { | ||
// If MetaMask is not installed, we use the default provider, | ||
// which is backed by a variety of third-party services (such | ||
|
@@ -25,13 +24,12 @@ const Login = () => { | |
// Connect to the MetaMask EIP-1193 object. This is a standard | ||
// protocol that allows Ethers access to make all read-only | ||
// requests through MetaMask. | ||
// @ts-expect-error ethereum is defined in the browser | ||
provider = new ethers.BrowserProvider(window.ethereum); | ||
|
||
// It also provides an opportunity to request access to write | ||
// operations, which will be performed by the private key | ||
// that MetaMask manages for the user. | ||
newSigner = await provider.getSigner(); | ||
newSigner = await (provider as ethers.BrowserProvider).getSigner(); | ||
|
||
setSigner(newSigner); | ||
const address = await newSigner?.getAddress(); | ||
|
@@ -46,7 +44,6 @@ const Login = () => { | |
async function runEffect() { | ||
const storedSignerAddress = localStorage.getItem('signerAddress'); | ||
if (storedSignerAddress) { | ||
// @ts-expect-error ethereum is defined in the browser | ||
const provider = new ethers.BrowserProvider(window.ethereum); | ||
const newSigner = await provider.getSigner(); | ||
setSigner(newSigner); | ||
|
@@ -89,9 +86,9 @@ function XmtpLogin({ signer }: { signer: Signer }) { | |
redirect({ to: '/space/$spaceId', params: { spaceId: 'abc' } }); | ||
}; | ||
|
||
// biome-ignore lint/correctness/useExhaustiveDependencies: <explanation> | ||
useEffect(() => { | ||
void initXmtpWithKeys(); | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, []); | ||
|
||
if (isLoading) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,19 +4,30 @@ | |
"type": "module", | ||
"workspaces": ["apps/*", "packages/*"], | ||
"devDependencies": { | ||
"@babel/cli": "^7.25.9", | ||
"@babel/core": "^7.26.0", | ||
"@babel/plugin-transform-export-namespace-from": "^7.25.9", | ||
"@babel/plugin-transform-modules-commonjs": "^7.25.9", | ||
"@biomejs/biome": "1.9.4", | ||
"@effect/build-utils": "^0.7.8", | ||
"babel-plugin-annotate-pure-calls": "^0.4.0", | ||
"escape-string-regexp": "^5.0.0", | ||
"typescript": "^5.6.3", | ||
"vite": "^5.4.10", | ||
"vitest": "^2.1.4", | ||
"vite-plugin-dts": "^4.3.0" | ||
}, | ||
"scripts": { | ||
"build": "pnpm --filter graph-framework-utils build", | ||
"build": "tsc -b tsconfig.build.json && pnpm --recursive --parallel run build", | ||
"ts:check": "pnpm -r ts:check", | ||
"test": "pnpm -r test", | ||
"lint": "pnpm -r lint", | ||
"format": "pnpm -r format", | ||
"check": "pnpm -r check" | ||
}, | ||
"pnpm": { | ||
"patchedDependencies": { | ||
"[email protected]": "patches/[email protected]" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We'll also need to remember to add the changeset patches. Otherwise every minor or patch bump of a dependent package will cause a major version increment. |
||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023-present The Contributors | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Graph Framework Identity | ||
|
||
Utilities around identity/authentication in the Graph Framework |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
{ | ||
"extends": "../../tsconfig.options.json", | ||
"extends": "./tsconfig.src.json", | ||
"references": [{ "path": "../graph-framework-utils/tsconfig.build.json" }], | ||
"compilerOptions": { | ||
"outDir": "./dist", | ||
"rootDir": "./src" | ||
"tsBuildInfoFile": ".tsbuildinfo/build.tsbuildinfo", | ||
"outDir": "build/esm", | ||
"declarationDir": "build/dts", | ||
"stripInternal": true | ||
}, | ||
"include": ["./src"], | ||
"exclude": ["node_modules", "src/**/*.test.ts", "src/**/*.spec.ts", "dist"] | ||
"exclude": ["node_modules", "src/**/*.test.ts", "src/**/*.spec.ts"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,5 @@ | ||
{ | ||
"extends": "../../tsconfig.options.json", | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"rootDir": ".", | ||
"noEmit": true | ||
}, | ||
"include": ["**/*", "vite.config.mts"], | ||
"exclude": ["**/node_modules", "**/dist"] | ||
"extends": "../../tsconfig.base.json", | ||
"include": [], | ||
"references": [{ "path": "tsconfig.src.json" }] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"include": ["src"], | ||
"references": [{ "path": "../graph-framework-utils" }], | ||
"compilerOptions": { | ||
"tsBuildInfoFile": ".tsbuildinfo/src.tsbuildinfo", | ||
"rootDir": "src", | ||
"outDir": "build/src" | ||
} | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { defineConfig } from 'vitest/config'; | ||
|
||
export default defineConfig({ | ||
test: { | ||
globals: true, | ||
environment: 'jsdom', | ||
}, | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023-present The Contributors | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Graph Framework Schema | ||
|
||
Tools to generate and define the space schema |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤮🤮🤮🤮