Git Product home page Git Product logo

nextjs-toolbox's Issues

Adds maintenance tooling

Summary

To make sure that our project stays up to date we'd like to add some tools:

  • Cypress integration (for testing e2e, ref doc here)
  • Renovate (for dependency management)
    add 'renovate.json` to project root
    {
      "$schema": "https://docs.renovatebot.com/renovate-schema.json",
      "extends": [
        "local>netlify-templates/renovate-config"
      ]
    }
    
  • Disable dependabot secutrity and version update alerts
  • Make sure to update the README on how to remove everything
    • add section on cypress removal
    • add section on removing renovate json file
    • add comment at top of renovate json saying it can be removed if not using renovate

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • cypress ^13.4.0
  • next ^14.0.1
  • react ^18.2.0
  • react-dom ^18.2.0
  • netlify-plugin-cypress 2.2.1

  • Check this box to trigger a request for Renovate to run again on this repository

Add a Netlify Redirect to redirect our Netlify Function

Summary

We will implement a redirect using the _redirects file. This file takes the highest priority for Netlify when performing redirects. We can show how and where to place this (i.e. the public/ folder). And put in the example of redirecting our function.

Update the README

Summary

Make a comprehensive readme about the features we're utilizing. Think about also adding a section for what could a second deploy feature potential. Such as adding a plugin or introducing env vars through CLI.

Add a Feedback form using Netlify Form

Summary

Utilize a Netlify Form. This will be a contact form example. We can demonstrate the the netlify attribute. We can show off the honeypot technique as well. And then in the README, we mention that they can see their form submissions within the UI.

  • Name
  • Email
  • Body

fix invalid 'for' DOM property

event - compiled client and server successfully in 77 ms (193 modules)
Warning: Invalid DOM property `for`. Did you mean `htmlFor`?
    at label
    at form
    at FeedbackForm
    at main
    at div
    at Home
    at Application (webpack-internal:///./pages/_app.js:11:24)
    at InnerApp
    at StyleRegistry (/Users/tzmanics/Documents/NETLIFY/CODE/TEMPLATES/nextjs-toolbox/node_modules/styled-jsx/dist/stylesheet-registry.js:231:34)
    at AppContainer (/Users/tzmanics/Documents/NETLIFY/CODE/TEMPLATES/nextjs-toolbox/node_modules/next/dist/server/render.js:340:29)
    at AppContainerWithIsomorphicFiberStructure (/Users/tzmanics/Documents/NETLIFY/CODE/TEMPLATES/nextjs-toolbox/node_modules/next/dist/server/render.js:370:57)
    at div
    at Body (/Users/tzmanics/Documents/NETLIFY/CODE/TEMPLATES/nextjs-toolbox/node_modules/next/dist/server/render.js:638:21)

due to label for= code like here:

<label for="name">Name</label>

Add (another) Netlify Plugin

Summary

While this project uses a plugin for supporting Next.js, we want to show case how to integrate another plugin with our project such as @netlify/a11y-plugin. This would be another addition within the netlify.toml as opposed to through the UI.

Missing plugin dependencies

Not sure about the policy in this matter, but I've found one inconsistency while trying to run the project.

When I spinned up this project on netlify from the github repo, everything works fine out of the box. It worked both for manual installation (creating repo first and then importing to netflify) and the direct start from the templates.

The problem occured when I tried to run the same project from the bitbucket repo. I couldn't find any explicit error, but the page hasn't been deployed correctly. Deploy was successful with cypress errors and page was not found when visiting the production url.

After digging up I've finally realised that when you spin up the project from github, netlify detects that this is a next.js app and applies the @netlify/plugin-nextjs plugin under the hood (it's visible in the UI plugins section). In case of bitbucket I had to do that step manually within the UI or add config section:

[[plugins]]
  package = "@netlify/plugin-nextjs"

along with adding proper dev dependency to package.json.

If this plugin is required to correctly run the app in the netlify, maybe it's better to add it to the config, to avoid inconsistencies across multiple git providers? Alternatively netlify plugin that autodetects the project's framework could be improved, but IMHO explicit dependencies seems to be cleaner and allow to avoid similar issues in the future.

Thanks for the starter anyway. It's really helpful! :)

I found a new issue

Replit: Updating package configuration

--> npm install @components/Footer @components/Header @components/JokeBlock @styles/globals.css next @components/FeedbackForm
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@components%2fFeedbackForm - Not found
npm ERR! 404
npm ERR! 404 '@components/FeedbackForm@*' is not in this registry.
npm ERR! 404 This package name is not valid, because
npm ERR! 404 1. name can no longer contain capital letters
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2022-05-28T07_50_42_686Z-debug.log
exit status 1

Add a Netlify Function to return a random joke

Summary

We need to create a Netlify Function. We can start with a function that will return a random joke when we make a request to it. This can help us show how to abstract data files away from function code and show that we can import it!

Add details around _redirects within the README section for Redirects

Related to #10, it would be good to share how to utilize the _redirects file way of doing things. If there are certain cases where this would be preferred as opposed to in the TOML.

The advantage of the TOML way is that it allows folks to see all Netlify features at once. But the drawback is that it is processed after the _redirects file. Whereas the _redirects file's downside is that it needs to be put in the right place for a project (e.g. in this project it would need to be placed in the public/ directory).

I'd love other's perspective on this!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.