Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Change project to Nextjs #1

Merged
merged 4 commits into from
Dec 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
41 changes: 35 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,37 @@
node_modules
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

/.cache
/.vercel
/.output
# dependencies
/node_modules
/.pnp
.pnp.js

/public/build
/api/build
# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

# typescript
*.tsbuildinfo
14 changes: 14 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
"stories": [
"../stories/**/*.stories.mdx",
"../stories/**/*.stories.@(js|jsx|ts|tsx)"
],
"addons": [
"@storybook/addon-links",
"@storybook/addon-essentials"
],
"framework": "@storybook/react",
"core": {
"builder": "webpack5"
}
}
9 changes: 9 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
}
61 changes: 19 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,34 @@
# Welcome to Remix!
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

- [Remix Docs](https://remix.run/docs)
## Getting Started

## Vercel Setup
First, run the development server:

First you'll need the [Vercel CLI](https://vercel.com/docs/cli):

```sh
npm i -g vercel
```

Before you can run the app in development, you need to link this project to a new Vercel project on your account.

**It is important that you use a new project. If you try to link this project to an existing project (like a Next.js site) you will have problems.**

```sh
$ vercel link
```bash
npm run dev
# or
yarn dev
```

Follow the prompts, and when it's done you should be able to get started.
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

## Development
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.

You will be running two processes during development when using Vercel as your server.
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.

- Your Vercel server in one
- The Remix development server in another
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

```sh
# in one tab
$ vercel dev
## Learn More

# in another
$ npm run dev
```

Open up [http://localhost:3000](http://localhost:3000) and you should be ready to go!

If you'd rather run everything in a single tab, you can look at [concurrently](https://npm.im/concurrently) or similar tools to run both processes in one tab.
To learn more about Next.js, take a look at the following resources:

## Deploying
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

```sh
$ npm run build
# preview deployment
$ vercel

# production deployment
$ vercel --prod
```
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

### GitHub Automatic Deployments
## Deploy on Vercel

For some reason the GitHub integration doesn't deploy the public folder. We're working with Vercel to figure this out.
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.

For now, [you can set up a GitHub action with this config](https://gist.github.com/mcansh/91f8effda798b41bb373351fad217070) from our friend [@mcansh](https://github.com/mcansh).
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
21 changes: 21 additions & 0 deletions __tests__/index.test.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// __tests__/index.test.jsx

/**
* @jest-environment jsdom
*/

import React from 'react';
import { render, screen } from '@testing-library/react';
import Home from '../pages/index';

describe('Home', () => {
it('renders a heading', () => {
render(<Home />);

const heading = screen.getByRole('heading', {
name: /welcome to next\.js!/i,
});

expect(heading).toBeInTheDocument();
});
});
5 changes: 0 additions & 5 deletions api/index.js

This file was deleted.

4 changes: 0 additions & 4 deletions app/entry.client.tsx

This file was deleted.

21 changes: 0 additions & 21 deletions app/entry.server.tsx

This file was deleted.

Loading