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

Upgrades from yarn 1.x to yarn berry (4.x) #147

Merged
merged 10 commits into from
Jan 23, 2024
Merged
Binary file added .yarn/install-state.gz
Binary file not shown.
893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.0.2.cjs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.0.2.cjs
7 changes: 3 additions & 4 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "0.1.0",
"private": true,
"scripts": {
"setup": "vercel env pull",
"dev": "next dev",
"build": "next build",
"start": "next start",
Expand All @@ -22,11 +21,11 @@
"react-use-async-callback": "^2.1.2"
},
"devDependencies": {
"eslint": "8.54.0",
"eslint-config-next": "13.2.4",
"@types/node": "20.11.5",
"@types/react": "18.2.3",
"@types/react": "18.2.48",
"@types/react-dom": "18.2.18",
"eslint": "8.54.0",
"eslint-config-next": "13.2.4",
"typescript": "5.0.3"
},
"engines": {
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@
"license": "Apache-2.0",
"private": true,
"workspaces": [
"apps/*",
"packages/*"
"apps/*"
],
"scripts": {
"dev": "yarn --cwd apps/web dev",
"lint": "yarn --cwd apps/web lint --fix && yarn --cwd apps/firebase lint --fix",
"setup": "yarn global add vercel@latest",
"prepare": "husky install",
arthurgousset marked this conversation as resolved.
Show resolved Hide resolved
"prettify": "yarn prettier --write \"apps/**/*.{ts,tsx}\" --ignore-path=./.gitignore"
},
Expand All @@ -28,5 +26,6 @@
},
"engines": {
"node": "20"
}
},
"packageManager": "[email protected]"
}
85 changes: 84 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,90 @@ This Repo contains the code for the alfajores faucet. This is contained in 2 app

The web app deploys automatically to vercel.

To setup the web app to run locally set the vercel project to clabs/faucet and the env variables from vercel with `vercel env pull` then run `yarn dev`
## Setup

### Wep app

To set up the web app to run locally:

1. navigate to the `apps/web` folder

```sh
$ cd apps/web
```

1. link your local repository to the `faucet` project on Vercel

```sh
$ yarn dlx vercel@latest link
```

You'll be asked to authenticate with your Vercel account. Once you've done that, you'll be
guided through a series of prompts to link your local project to the `faucet` Vercel project.

```
? Set up “~/Documents/celo-org/faucet/apps/web”? [Y/n] y
? Which scope should contain your project? Celo Ecosystem Project Hosting
? Link to existing project? [y/N] y
? What’s the name of your existing project? faucet
✅ Linked to c-labs/faucet (created .vercel)
```

1. fetch environment variables from Vercel

```sh
$ yarn dlx vercel@latest env pull
```

If you get an error like `Error! No project found`, you may need to run `vercel link` again.
If everything worked, you should see a message like this:

```sh
> Downloading `development` Environment Variables for Project faucet
✅ Created .env.local file [249ms]
```

1. run the app locally

```sh
$ yarn dev
```

You should see a message like this:

```sh
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info - Loaded env from /Users/arthur/Documents/celo-org/faucet/apps/web/.env.local
```

You can now view the app in your browser at http://localhost:3000.

## Firebase app

To set up the firebase app to run locally:

1. navigate to the `apps/firebase` folder
```sh
$ cd apps/firebase
```
1. login to firebase
```sh
$ yarn dlx firebase-tools@latest login
```
You'll be asked to authenticate with your Firebase account.
1. build the firebase app
```sh
$ yarn run preserve
```
1. ensure that you are on required node version specified in `engines.node` in
`firebase/package.json`. Currently this is Node 20 at the time of writing.
```sh
$ nvm use <the-required-node-version>
```
1. run the firebase app locally
```sh
$ yarn run serve
```

## Adding chains

Expand Down
Loading