-
Notifications
You must be signed in to change notification settings - Fork 604
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aaa8ce7
commit 2834f97
Showing
43 changed files
with
2,860 additions
and
427 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@rainbow-me/create-rainbowkit': patch | ||
--- | ||
|
||
Initial beta release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
coverage | ||
.next | ||
dist | ||
dist | ||
*-app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
function readPackage(pkg) { | ||
// Filter dependencies in app templates that are present in the root package.json. | ||
// This allows us to provide complete package.json files for all app templates. | ||
if (/-app$/.test(pkg.name)) { | ||
pkg.dependencies = omitRootDependencies(pkg.name, pkg.dependencies); | ||
pkg.devDependencies = omitRootDependencies(pkg.name, pkg.devDependencies); | ||
} | ||
|
||
return pkg; | ||
} | ||
|
||
module.exports = { | ||
hooks: { | ||
readPackage, | ||
}, | ||
}; | ||
|
||
function omitRootDependencies(packageName, dependencies) { | ||
const packageJson = require('./package.json'); | ||
const rootDependencies = { | ||
...packageJson.dependencies, | ||
...packageJson.devDependencies, | ||
}; | ||
|
||
const filteredDependencies = {}; | ||
const allowedDuplicatePackages = [ | ||
// We're on an older version of eslint due to eslint-config-rainbow | ||
// so we need to allow multiple versions for now. | ||
'eslint', | ||
]; | ||
|
||
Object.keys(dependencies).forEach(dep => { | ||
if (!rootDependencies[dep] || allowedDuplicatePackages.includes(dep)) { | ||
// Keep the dependency in the app template's package.json since it's not in the | ||
// root package.json (or in the list of allowed duplicate packages). | ||
filteredDependencies[dep] = dependencies[dep]; | ||
} else if (rootDependencies[dep] !== dependencies[dep]) { | ||
throw new Error( | ||
[ | ||
`Dependency ${dep} has different version in root package.json. Root: ${rootDependencies[dep]}, ${packageName}: ${dependencies[dep]}`, | ||
packageName === 'generated-test-app' && | ||
'You might have stale files left over from a past create-rainbowkit run. Try running "pnpm test:cli:clean" and then "pnpm test:cli:dev" after install to regenerate test app.', | ||
] | ||
.filter(Boolean) | ||
.join('\n') | ||
); | ||
} | ||
}); | ||
|
||
return filteredDependencies; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ coverage | |
dist | ||
packages/*/CHANGELOG.md | ||
site/CHANGELOG.md | ||
.contentlayer | ||
.contentlayer | ||
generated-test-app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# 🌈🚀 create-rainbowkit | ||
|
||
Scaffold a new RainbowKit project. | ||
|
||
```bash | ||
npm init @rainbow-me/rainbowkit | ||
# or | ||
yarn create @rainbow-me/rainbowkit | ||
# or | ||
pnpm create @rainbow-me/rainbowkit | ||
``` | ||
|
||
## License | ||
|
||
Licensed under the MIT License, Copyright © 2022-present [Rainbow](https://rainbow.me). | ||
|
||
See [LICENSE](./LICENSE) for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* eslint-disable no-console, import/no-extraneous-dependencies */ | ||
import * as esbuild from 'esbuild'; | ||
|
||
const isWatching = process.argv.includes('--watch'); | ||
|
||
esbuild | ||
.build({ | ||
bundle: true, | ||
entryPoints: ['./src/cli.ts'], | ||
format: 'esm', | ||
outdir: 'dist', | ||
platform: 'node', | ||
plugins: [ | ||
{ | ||
name: 'make-all-packages-external', | ||
setup(build) { | ||
let filter = /^[^./]|^\.[^./]|^\.\.[^/]/; // Must not start with "/" or "./" or "../" | ||
build.onResolve({ filter }, args => ({ | ||
external: true, | ||
path: args.path, | ||
})); | ||
}, | ||
}, | ||
], | ||
watch: isWatching | ||
? { | ||
onRebuild(error, result) { | ||
if (error) console.error('watch build failed:', error); | ||
else console.log('watch build succeeded:', result); | ||
}, | ||
} | ||
: undefined, | ||
}) | ||
.then(() => { | ||
if (isWatching) { | ||
console.log('watching...'); | ||
} | ||
}) | ||
.catch(() => process.exit(1)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "next/core-web-vitals" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.pnpm-debug.log* | ||
|
||
# local env files | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
strict-peer-dependencies = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
This is a [RainbowKit](https://rainbowkit.com) + [wagmi](https://wagmi.sh) + [Next.js](https://nextjs.org/) project bootstrapped with [`create-rainbowkit`](https://github.com/rainbow-me/rainbowkit/tree/main/packages/create-rainbowkit). | ||
|
||
## Getting Started | ||
|
||
First, run the development server: | ||
|
||
```bash | ||
npm run dev | ||
``` | ||
|
||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. | ||
|
||
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file. | ||
|
||
## Learn More | ||
|
||
To learn more about this stack, take a look at the following resources: | ||
|
||
- [RainbowKit Documentation](https://rainbowkit.com) - Learn how to customize your wallet connection flow. | ||
- [wagmi Documentation](https://wagmi.sh) - Learn how to interact with Ethereum. | ||
- [Next.js Documentation](https://nextjs.org/docs) - Learn how to build a Next.js application. | ||
|
||
You can check out [the RainbowKit GitHub repository](https://github.com/rainbow-me/rainbowkit) - your feedback and contributions are welcome! | ||
|
||
## Deploy on Vercel | ||
|
||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. | ||
|
||
Check out the [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/image-types/global" /> | ||
|
||
// NOTE: This file should not be edited | ||
// see https://nextjs.org/docs/basic-features/typescript for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
reactStrictMode: true, | ||
}; | ||
|
||
module.exports = nextConfig; |
26 changes: 26 additions & 0 deletions
26
packages/create-rainbowkit/generated-test-app/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "generated-test-app", | ||
"private": true, | ||
"version": "0.1.0", | ||
"scripts": { | ||
"dev": "next dev", | ||
"build": "next build", | ||
"start": "next start", | ||
"lint": "next lint" | ||
}, | ||
"dependencies": { | ||
"@rainbow-me/rainbowkit": "workspace:*", | ||
"ethers": "^5.6.8", | ||
"next": "^12.1.6", | ||
"react": "^18.1.0", | ||
"react-dom": "^18.1.0", | ||
"wagmi": "^0.4.2" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^17.0.35", | ||
"@types/react": "^18.0.9", | ||
"eslint": "^8.15.0", | ||
"eslint-config-next": "^12.1.6", | ||
"typescript": "^4.7.2" | ||
} | ||
} |
Oops, something went wrong.
2834f97
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.
Successfully deployed to the following URLs:
rainbowkit-example – ./
rainbowkit-example-git-main-rainbowdotme.vercel.app
rainbowkit-example-rainbowdotme.vercel.app
rainbowkit-example.vercel.app
2834f97
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.
Successfully deployed to the following URLs:
rainbowkit-site – ./
rainbowkit-site-rainbowdotme.vercel.app
rainbowkit.com
rainbowkit-site-git-main-rainbowdotme.vercel.app
rainbowkit.vercel.app
www.rainbowkit.com