Skip to content
Draft
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ typings/
.cache/
public

# Next.js files
.next/

# Mac files
.DS_Store

Expand Down
36 changes: 15 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@
### Start developing

1. Navigate into root directory;
2. Run `npm start`. Site will open at `http://localhost:8001`. You'll also see a second link for GraphQL: http://localhost:8001/\_\_\_graphql.
3. Open the source code and start editing!
2. Run `npm install --legacy-peer-deps --ignore-scripts` (keeps local setup resilient when Cypress binary download is blocked);
3. Run `npm start`. Site will open at `http://localhost:8001`.
4. Build for production with `npm run build`.
5. Run tests with `npm test`.
6. The application now runs on Next.js App Router (`src/app`) while preserving framework-agnostic UI templates in `src/templates`, so future migrations (Gatsby/Next/Remix) stay incremental.
7. Open the source code and start editing!
Save your changes and the browser will update in real time!

## How to contribute?
Expand Down Expand Up @@ -71,17 +75,14 @@ This project follows the [all-contributors](https://github.com/all-contributors/

## 🧐 What's inside?

A quick look at the top-level files and directories you'll see in a Gatsby project.
A quick look at the top-level files and directories in this Next.js project.

.
├── node_modules
├── src
├── .gitignore
├── .prettierrc
├── gatsby-browser.js
├── gatsby-config.js
├── gatsby-node.js
├── gatsby-ssr.js
├── next.config.js
├── LICENSE
├── package-lock.json
├── package.json
Expand All @@ -95,18 +96,11 @@ A quick look at the top-level files and directories you'll see in a Gatsby proje

4. **`.prettierrc`**: This is a configuration file for [Prettier](https://prettier.io/). Prettier is a tool to help keep the formatting of your code consistent.

5. **`gatsby-browser.js`**: This file is where Gatsby expects to find any usage of the [Gatsby browser APIs](https://www.gatsbyjs.org/docs/browser-apis/) (if any). These allow customization/extension of default Gatsby settings affecting the browser.

6. **`gatsby-config.js`**: This is the main configuration file for a Gatsby site. This is where you can specify information about your site (metadata) like the site title and description, which Gatsby plugins you’d like to include, etc. (Check out the [config docs](https://www.gatsbyjs.org/docs/gatsby-config/) for more detail).

7. **`gatsby-node.js`**: This file is where Gatsby expects to find any usage of the [Gatsby Node APIs](https://www.gatsbyjs.org/docs/node-apis/) (if any). These allow customization/extension of default Gatsby settings affecting pieces of the site build process.

8. **`gatsby-ssr.js`**: This file is where Gatsby expects to find any usage of the [Gatsby server-side rendering APIs](https://www.gatsbyjs.org/docs/ssr-apis/) (if any). These allow customization of default Gatsby settings affecting server-side rendering.

5. **`next.config.js`**: Next.js build/runtime configuration.
6. **`src/app`**: App Router entries (`layout`, route pages, metadata routes).
7. **`src/templates`**: Framework-agnostic page templates reused independently from routing framework.
8. **`src/framework`**: Thin routing/runtime adapters that isolate framework specifics.
9. **`LICENSE`**: This project is licensed under the MIT license.

10. **`package-lock.json`** (See `package.json` below, first). This is an automatically generated file based on the exact versions of your npm dependencies that were installed for your project. **(You won’t change this file directly).**

11. **`package.json`**: A manifest file for Node.js projects, which includes things like metadata (the project’s name, author, etc). This manifest is how npm knows which packages to install for your project.

12. **`README.md`**: A text file containing useful reference information about your project.
10. **`package-lock.json`**: Auto-generated lockfile for exact dependency versions.
11. **`package.json`**: Project metadata and npm scripts/dependencies.
12. **`README.md`**: Project documentation.
33 changes: 33 additions & 0 deletions TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,3 +382,36 @@ npm run develop

Do **not** leave `gatsby develop` running while deleting or partially rewriting `node_modules` — that is the usual way this ENOENT storm starts.


## npm install fails downloading Cypress binary (ENOTFOUND download.cypress.io)

Given dependency install fails in restricted/offline environments:

```sh
npm install --legacy-peer-deps
# ...
# The Cypress App could not be downloaded.
# URL: https://download.cypress.io/desktop/14.5.4?platform=linux&arch=x64
# Error: getaddrinfo ENOTFOUND download.cypress.io
```

1. Re-run install without lifecycle scripts so Cypress binary download is skipped:

```sh
npm install --legacy-peer-deps --ignore-scripts
```

2. Run unit tests/build that do not require Cypress binary;
3. If you need E2E locally, run install again in a network with access to `download.cypress.io`.

## Next.js build fails with `App Router and Pages Router both match path`

Given `next build` reports route conflicts like:

```txt
App Router and Pages Router both match path: /
```

1. Keep App Router entries under `src/app`;
2. Remove or relocate legacy `src/pages` routes that mirror the same paths;
3. Re-run `npm run build`.
9 changes: 4 additions & 5 deletions config/siteMetadata/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
require("dotenv").config({
path: `.env.${process.env.NODE_ENV}`,
})

const siteName = "Multei!"

const siteMetadata = {
Expand All @@ -12,7 +8,10 @@ const siteMetadata = {
display: "standalone",
lang: "pt-br",
icon: "src/images/icon.png",
googleSiteVerification: process.env.GATSBY_GOOGLE_SITE_VERIFICATION || "0",
googleSiteVerification:
process.env.NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION ||
process.env.GATSBY_GOOGLE_SITE_VERIFICATION ||
"0",
siteName,
siteUrl: "https://multei.com.br",
startUrl: "/",
Expand Down
16 changes: 16 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const path = require("path")

/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
webpack: (config) => {
config.resolve.alias.gatsby = path.resolve(
__dirname,
"src/framework/gatsby-shim.js"
)

return config
},
}

module.exports = nextConfig
Loading
Loading