Skip to content

Commit

Permalink
chore(build): switch package manager from npm to yarn (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
iczc authored Feb 13, 2023
1 parent d6d8d13 commit a63b2a9
Show file tree
Hide file tree
Showing 11 changed files with 399 additions and 487 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ jobs:
with:
node-version: "14"

- run: npm ci
- run: yarn install
working-directory: web

- run: npx prettier --check 'src/**/*.{css,html,js,svelte}'
- run: yarn prettier --check 'src/**/*.{css,html,js,svelte}'
working-directory: web
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ cd eth-faucet

2. Bundle Frontend web with Vite
```bash
npm run build
go generate
```

3. Build Go project
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"scripts": {
"build": "cd web && npm ci --production=false && npx vite build"
"build": "npm install -g yarn && cd web && yarn install && yarn vite build"
}
}
2 changes: 1 addition & 1 deletion web/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dist-ssr
*.local

# Editor directories and files
.vscode/*
.vscode/extensions.json
!.vscode/extensions.json
.idea
.DS_Store
Expand Down
8 changes: 4 additions & 4 deletions web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@ This is the Frontend of [eth-faucet](https://github.com/chainflag/eth-faucet) bu

## Get started

*Note that you will need to have [Node.js](https://nodejs.org) installed.*
*Note that you will need to have [Node.js](https://nodejs.org) and [Yarn](https://yarnpkg.com/) installed.*

Install the dependencies...

```bash
cd web
npm install
yarn install
```

...then start [vite](https://vitejs.dev/):

```bash
npm run dev
yarn run dev
```

Navigate to [localhost:5173](http://localhost:5173). You should see your app running. Edit a component file in `src`, save it, and reload the page to see your changes.

To create an optimised version of the app:

```bash
npm run build
yarn run build
```
7 changes: 5 additions & 2 deletions web/jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
/**
* Typecheck JS in `.svelte` and `.js` files by default.
* Disable this if you'd like to use dynamic types.
Expand All @@ -30,5 +29,9 @@
* Use global.d.ts instead of compilerOptions.types
* to avoid limiting type declarations.
*/
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
"include": [
"src/**/*.d.ts",
"src/**/*.js",
"src/**/*.svelte"
]
}
Loading

0 comments on commit a63b2a9

Please sign in to comment.