Skip to content

Commit

Permalink
Switch to Vercel analytics (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
crudh committed Feb 13, 2024
1 parent c3a6da6 commit 92c4260
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 8 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

This is a searchable catalog of vim commands organized by category. It's built as a PWA that works offline.

I did it as a hobby project to force myself to learn vim and play with some tech. Hopefully in the future it will be more extensive with examples etc.

It is built using React, Next, TypeScript, Tailwind and hosted on Vercel.

## Getting Started
Expand All @@ -20,14 +18,14 @@ npm i
npm run dev
```

And go to [http://localhost:3000/](http://localhost:3000/)
And go to [http://localhost:3011/](http://localhost:3011/)

## Preview production mode

```
npm run preview
```

And go to [http://localhost:4000/](http://localhost:4000/)
And go to [http://localhost:4011/](http://localhost:4011/)

This will build the production bundle and run the server in production mode. But it will use port 4000 so the service worker doesn't interfer with the dev mode (which runs without a service worker).
This will build the production bundle and run the server in production mode. But it will use port 4011 so the service worker doesn't interfer with the dev mode (which runs without a service worker).
27 changes: 27 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "next dev",
"preview": "next build && next start -p 4000",
"dev": "next dev -p 3011",
"preview": "next build && next start -p 4011",
"build": "next build",
"start": "next start",
"lint": "eslint src",
"analyze": "cross-env ANALYZE=true next build"
},
"dependencies": {
"@vercel/analytics": "^1.1.3",
"next": "^11.0.1",
"next-pwa": "^5.0.3",
"react": "^17.0.1",
Expand Down
4 changes: 3 additions & 1 deletion src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { FC } from "react";
import type { AppProps } from "next/app";
import Head from "next/head";
import { Analytics } from "@vercel/analytics/react";
import { Menu } from "../components/menu";
import "../../styles/index.css";

Expand All @@ -23,10 +24,11 @@ const App: FC<AppProps> = ({ Component, pageProps }) => (
<header className="p-2 pb-8">
<h1>vim.how</h1>
</header>
<main className="w-full flex flex-1 flex-col items-center">
<main className="flex flex-col items-center flex-1 w-full">
<Component {...pageProps} />
</main>
</div>
<Analytics />
</>
);

Expand Down

0 comments on commit 92c4260

Please sign in to comment.