Skip to content
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

Feat: Argent one button connector #53

Open
wants to merge 21 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
965bdb2
feat: add `Argent` one button connector to `next`
Cussone Oct 31, 2024
87521ff
chore: ignore `.idea`
Cussone Oct 31, 2024
50ac63a
chore: ignore ts error
Cussone Oct 31, 2024
5a411cb
chore: bump `starknetkit-next` to `v2.4.0-beta.3`
Cussone Nov 1, 2024
160b746
fix: react warning
Cussone Nov 1, 2024
c6fbc70
chore: bump `starknetkit-next` to `v2.4.0-beta.4`
Cussone Nov 1, 2024
d003b03
chore: bump `@argent/x-sessions` to `6.7.10`
Cussone Nov 6, 2024
db52571
chore: commit `pnpm-lock.yaml`
Cussone Nov 6, 2024
796738f
chore: generate fresh `pnpm-lock.yaml`
Cussone Nov 6, 2024
771adbe
fix: package error
Cussone Nov 6, 2024
4d6e79f
chore: downgrade `@chakra-ui/react`, remove `@emotion/*`
Cussone Nov 6, 2024
58ca413
chore: update `starknetkit` to `v2.4.0-beta.6`, adapt usage
Cussone Nov 7, 2024
a95b204
chore: remove `packageManager` from `package.json`
Cussone Nov 8, 2024
5c50e86
chore: add `BraavosMobileConnector`
Cussone Nov 13, 2024
6efdafa
chore: bump `starknetkit-next` to `2.5.0-beta.1`
Cussone Nov 13, 2024
4ef6c84
feat: add script for hot reloading local packages
Cussone Nov 14, 2024
67be021
fix: skip hot reloading packages that are not locally imported
Cussone Nov 14, 2024
4149d8b
Merge pull request #57 from argentlabs/feat/hot-reload-local-packages
Cussone Nov 14, 2024
5cc714a
chore: install `[email protected]`
Cussone Nov 15, 2024
d2de42f
chore: set `starknetkit-latest` to `v2.6.1`
Cussone Dec 10, 2024
af73242
refactor: `starknetkit-latest` for usage of `v2.6.1`
Cussone Dec 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,4 @@ dist
.yarn/install-state.gz
.pnp.*
.vercel
.idea
57 changes: 57 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
/** @type {import('next').NextConfig} */
import p from "./package.json" assert { type: "json" }
import path from "path"
import { fileURLToPath } from "url"
import { createRequire } from "module"

const require = createRequire(import.meta.url)

const starknetkitNextVersion = Object.entries(p.dependencies)
.find((dep) => dep[0] === "starknetkit-next")[1]
Expand All @@ -24,6 +29,13 @@ const starknetReactNextVersion = Object.entries(p.dependencies)
.replace("npm:", "")
.split("@")[2]

const localPackages = [
{
name: "starknetkit-next",
path: "../starknetkit",
},
]

const nextConfig = {
productionBrowserSourceMaps: true,
env: {
Expand All @@ -32,6 +44,51 @@ const nextConfig = {
starknetReactVersion,
starknetReactNextVersion,
},
webpack: (config, { dev, webpack }) => {
if (!dev) {
return config
}

const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const packageJson = require(path.join(__dirname, "./package.json"))

config.resolve.alias = {
...config.resolve.alias,
...localPackages.reduce((aliases, pkg) => {
if (packageJson.dependencies[pkg.name].startsWith("file:")) {
return {
...aliases,
[pkg.name]: path.resolve(__dirname, pkg.path),
[`${pkg.name}/(.*)`]: path.resolve(__dirname, `${pkg.path}/$1`),
}
}

return { ...aliases }
}, {}),
}

localPackages.forEach((pkg) => {
if (!packageJson.dependencies[pkg.name].startsWith("file:")) {
return
}
config.plugins.push(
new webpack.NormalModuleReplacementPlugin(
new RegExp(`^${pkg.name}(\\/.*)?$`),
(resource) => {
const requestPath = resource.request.replace(pkg.name, "")
resource.request = path.resolve(
__dirname,
`${pkg.path}${requestPath}`,
)
resource.context = path.dirname(resource.request)
},
),
)
})

return config
},
}

export default nextConfig
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@
"format": "prettier --write ."
},
"dependencies": {
"@argent/x-sessions": "^6.7.8",
"@argent/x-sessions": "^6.7.10",
"@argent/x-shared": "^1.32.1",
"@chakra-ui/react": "^2.8.2",
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@chakra-ui/react": "2.8.2",
"@starknet-io/types-js": "^0.7.7",
"@starknet-react/chains": "^0.1.7",
"@starknet-react/core": "^2.8.2",
Expand All @@ -31,8 +29,8 @@
"starknet": "^6.11.0",
"starknet-react-chains-next": "npm:@starknet-react/[email protected]",
"starknet-react-core-next": "npm:@starknet-react/[email protected]",
"starknetkit-latest": "npm:starknetkit@^1.1.9",
"starknetkit-next": "npm:starknetkit@^2.3.1"
"starknetkit-latest": "npm:starknetkit@^2.6.1",
"starknetkit-next": "npm:starknetkit@2.5.0-beta.2"
},
"devDependencies": {
"@types/lodash-es": "^4.17.12",
Expand Down
Loading