Commit graph

51 commits

Author SHA1 Message Date
Steven
9f9214abe5
Updated create-next-app docs to include pnpm usage (#35755)
This PR updates the docs and examples for `create-next-app` to include pnpm usage.

The following script was used to update every example README:

```js
const fs = require('fs')
const examples = fs.readdirSync('./examples')

for (let example of examples) {
    const filename = `./examples/${example}/README.md`
    const markdown = fs.readFileSync(filename, 'utf8')
    const regex = new RegExp(`^yarn create next-app --example (.*)$`, 'gm')
    const output = markdown.replace(regex, (yarn, group) => {
        const pnpm = `pnpm create next-app -- --example ${group}`
        return `${yarn}\n# or\n${pnpm}`
    })
    fs.writeFileSync(filename, output)
}
```
2022-03-30 21:03:21 +00:00
Chris Midgley
946f465a6e
fix(examples/with-docker): add npm comment for yarn build (#35040)
There was an `npm` equivalent for `yarn install` (`npm ci`) but not one for `yarn build`. I've added `npm run build` as a commented out option.

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2022-03-04 17:59:57 +00:00
Noam Nol
7ec5d29d1f
Add .git to .dockerignore in docker examples (#34628)
* Add .git to .dockerignore in with-docker-multi-env

* Add .git to .dockerignore in with-docker
2022-02-21 21:53:56 +01:00
Sebastián Espinosa
c1fd2ca79f
Adding step to build the app with docker in existing projects (#34083)
* Adding steps to build the app with docker in existing projects (without the need to create the app with the with-docker example)

* Update examples/with-docker/README.md

Fix uppercase

Co-authored-by: Balázs Orbán <info@balazsorban.com>

* lint-fix

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-02-11 15:27:10 -06:00
Stef
84b7d9a531
Remove unused "start" script from with-docker/package.json (#31053)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-02-05 15:49:54 -06:00
Ekaterina Anishkina
07d9c92124
fix(examples/with-docker): update env comments (#29972)
This fixes the comment about disabling telemetry. For now it doesn't disable telemetry for `next build` if you uncomment it.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes
2022-02-05 21:41:25 +00:00
Janne Sinivirta
97b5c0ae5e
Fix ambiguous flags in Dockerfile example (#33417)
* Fix ambiguous flags in Dockerfile example

At least with Docker xx this Dockerfile fails to both `adduser` and `addgroup` commands due to ambiguous flags. The error message for example for `addgroup` is:

```
#5 0.292 Option g is ambiguous (gecos, gid, group)
#5 0.292 Option s is ambiguous (shell, system)
```
This PR switches both commands to use the long-format flags. I think they are also more understandable for the readers of the Dockerfile.

* Apply suggestions from code review

Co-authored-by: Balázs Orbán <info@balazsorban.com>

Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-02-05 15:26:41 -06:00
JJ Kasper
d005631063
Update npm comment in Docker example (#33881) 2022-02-01 16:52:26 -06:00
Kryštof Krátký
33784f1342
Fix with-docker example dockerfile (#33695)
Fixed `dockerfile` in `with-docker`  example

## Bug

- error when executing `docker build -t nextjs-docker .` - `yarn.lock` file is missing

 ## Documentation / Examples

- edited to not fail when `package-lock.json` or `yarn.lock` are not found
- example: use `with-docker` example

- [x] Make sure the linting passes by running yarn lint

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-01-27 17:30:52 +00:00
Manny Becerra
36eba95227
Fixes #33153: Updating cross-references from master to main + canary (#33198)
* copy cleanup in env. variables docs

* copy cleanup in fast refresh docs

* Supplements #33153 - updating existing cross-references to `master` branch to renamed default branch of `main`

* Supplements #33153 - updating existing cross-references to `master` branch to renamed default branch of `main`

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-01-12 02:55:35 +01:00
JJ Kasper
c320249be1
Remove un-necessary second yarn install from example Dockerfile (#32934)
Update to remove the second `yarn install` step from the docker example as it is no longer needed since we only include necessary files from the output file traces now. 

Closes: https://github.com/vercel/next.js/pull/29360

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2022-01-01 20:49:43 +00:00
Marcelo Carmona
c87204eb77
Update 14-alpine to 16-alpine (#31777)
## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2021-12-16 06:35:25 +00:00
JJ Kasper
ca8fd316f1
Update docker image to leverage output traces (#32258)
This updates our docker example to leverage the output traces and standalone build to reduce the resulting docker image quite a bit. 

docker image size before: `272MB`
docker image size after: `121MB`
node-14:alpine size (base image): `118MB`

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`

x-ref: https://github.com/vercel/next.js/pull/32255
x-ref: https://github.com/vercel/next.js/issues/32252
x-ref: https://github.com/vercel/next.js/issues/30822
2021-12-13 13:11:12 +00:00
Aryan Beezadhur
e63322f432
Update Dockerfile (#32299)
Update `Dockerfile` to match [Next.js docs](https://nextjs.org/docs/deployment#docker-image).
2021-12-12 20:52:34 +00:00
stef
5abfea3765
Recommend using next CLI for Docker entrypoint and not yarn (#29024)
Fixes #29023 

## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes
2021-11-01 20:26:14 +00:00
hiro
a9c1bd797d
Fixed typos that existed on some files (#28314)
* fix: naviagtion -> navigation

* fix: compatability -> compatibility
2021-08-19 21:54:13 -05:00
Oscar Busk
077097b7f8
Remove licence from all example/package.json that has them (#28007)
* Add licences to all example/package.json that lack them

* Revert "Add licences to all example/package.json that lack them"

This reverts commit 5d4e25012f7334772b8ef5924bc355277e827cba.

* Update check-examples to remove `license` field from examples

* Remove `license` from all examples.

This was mentioned in vercel/next.js#27121 but it looks like it didn't end up being in the merge?

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-08-14 10:48:39 -05:00
Luc Leray
f52955ec94
Clean up examples package.json (#27121)
Clean up package.json files in the `examples` directory:
- Add `private: true`
- Remove `version` (because they are irrelevant for packages that are not meant to be published)
- Remove `name` (because they are optional for packages that are not meant to be published, and when someone clones an example, they often rename it and the property becomes stale)
- Remove `author`
- Remove `description`
- Remove `license`

Also remove `with-dynamic-app-layout` example completely, since it does the same as `layout-component` (https://github.com/vercel/next.js/pull/27121#discussion_r668178408).

## Documentation / Examples

- [x] Make sure the linting passes
2021-07-12 19:58:03 +00:00
Geshan Manandhar
b1b3b75774
Add run on Google Cloud Run button to the docker example (#25824)
## Documentation / Examples

- [x] Make sure the linting passes


### Deployed with Cloud Run Button

<img width="1075" alt="Screen Shot 2021-06-06 at 10 22 51 pm" src="https://user-images.githubusercontent.com/170554/120924210-d7946780-c715-11eb-889e-79679f795c54.png">

### Next.js working on Google Cloud Run

<img width="982" alt="Screen Shot 2021-06-06 at 10 23 10 pm" src="https://user-images.githubusercontent.com/170554/120924229-e418c000-c715-11eb-9aca-569923f7306d.png">
2021-06-07 21:32:04 +00:00
LiuuY
a38167f24b
Fix with-docker example fails to load image (#25536)
node version should be 14, otherwise, next/image fails to load static file images located in public dir
detail: https://stackoverflow.com/questions/67641673/next-js-app-running-inside-a-docker-container-fails-to-load-static-file-images
2021-05-28 11:56:12 -05:00
Martin Janeček
1f54ba6559
docs: reduce image size in sample Dockerfile (#24108) 2021-04-19 22:00:56 -05:00
Brais Antela
fa138358e1
Minor fix to build command (#24158)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.

## Documentation / Examples

- [x] Make sure the linting passes
2021-04-19 18:27:12 +00:00
Lee Robinson
d49f978a17
Update with-docker example and deployment docs. (#23486)
## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.

## Documentation / Examples

- [x] Make sure the linting passes
2021-03-28 20:32:09 +00:00
Richard Lee
e3244e96a6
Correct production docker base image tag (#19962)
As seen in https://github.com/mhart/alpine-node, the `base` image tag has been renamed to `slim`.
2020-12-08 15:43:24 +00:00
Nghiệp
111d2df90c
[Examples] Optimize with-docker (#17116)
* Fix missing yarn.lock
* Add --frozen-lockfile flag to speed up install deps
* Make sure node_modules do not contains devDependencies
* Add --targe stage docker build
2020-09-21 04:09:37 +00:00
Joe Haddad
f17d435166
Ensure all examples are MIT licensed (#16691) 2020-08-29 22:32:35 -04:00
NorbertLuszkiewicz
c03d4931de
Simplify example usage instructions (#16678)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-08-29 22:22:02 -04:00
Tanmay Laud
f00ad581a1
Added .gitignore to examples that are deployed to vercel (#15127)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-07-16 10:52:23 -04:00
Vinci Rufus
afa9bab11a
fixing the docker multi-stage build failures (#14513)
It looks like the docker multi-stage file wasn't building, so fixed that and also cleaned up some of the steps
2020-06-24 03:56:41 +00:00
Joe Haddad
7d038dfef1
Suggest npx over npm init (#13637)
This updates old examples to the more universal `npx` command.

Fixes https://github.com/vercel/next.js/discussions/12103
2020-06-01 17:36:57 +00:00
Joe Haddad
b7e17e09e5
Update references to zeit/next.js (#13463) 2020-05-27 17:51:11 -04:00
JJ Kasper
1f6ce106ae
Update codeload and deploy links for org rename (#13141)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-05-27 14:11:39 -04:00
Joe Haddad
dbad9db68c
Update Examples for Fast Refresh (#13068) 2020-05-18 17:44:18 -04:00
Tom Evans
6802805010
[Examples] Added public folder to with-docker example (#12879) 2020-05-18 13:08:28 -04:00
jmgr2996
dd264f582f
chore: Remove redundant imports in several examples (#13030) 2020-05-18 13:02:23 -04:00
Willian Justen
18dc1f66c6 Remove isomorphic-unfetch from examples (#12948)
Since 9.4 release, fetch is pollyfilled by default from #12353,
so the import is not needed anymore.
2020-05-15 22:23:55 +02:00
sdhani
7e39079462
Minor with-docker readme grammar fix (#11760)
* Fix with-docker readme grammar

* Amended with-docker readme grammar fix

Co-Authored-By: Luis Alvarez D. <luis@zeit.co>

Co-authored-by: Luis Alvarez D. <luis@zeit.co>
2020-04-08 19:07:12 -05:00
Tim Neutkens
7e2d476e44
Update examples to use getStaticProps where possible (#11136)
* Remove micro example

* Remove page that uses getInitialProps

* Update with-docker example

* Update dynamic import example

* Update Fela example

* Update Flow example

* Update framer motion example

* Remove freactal example

* Remove with-higher-order-component

* Remove with-immutable-redux-wrapper as it shows avenues to performance issues

* Remove example that doesn't have usage

* Update with-kea

* Remove example that is not used

* Update next-page-transitions example

* Remove next-routes example as dynamic routes are supported by default

* Add link to documentation

* Update Overmind example

* Update pretty-url-routing example

* Remove update with low usage

* Update with-react-ga example

* Update React Helmet example

* Remove mobile-detect from carousel example

* Remove react-useragent as it shows a bad practice

* Remove react-uwp example as it has low usage

* Remove recompose example as it shows outdated practices

* Remove refnux example as it has low usage

* Remove example that can be created using api routes

* Update with-segment-analytics

* Update socket.io example

* Remove socket.io example as it's shows bad practices

* Update static export example

* Update universal configuration example
2020-03-17 15:07:27 +01:00
Shu Uesugi
6804039e94 Make example READMEs more consistent (#10124)
* npx create → npm init

* Fix inconsistent instructions

* Update amp-first

* Update with-graphql-react

* with-firebase-cloud-messaging

* Update with-higher-order-component

* change create-next-app url

* Update create-next-app instruction

* Update instructions to use npm instead of npx

* Move "the idea behind the example" to top

* Rename

* Rename

* Update contributing.md with a README template
2020-01-16 23:23:56 +01:00
Vinci Rufus
2e3a972033 Update the docker multistage to copy only the necessary files (#9899)
* copy only the necessary files during stage 2 in multi-stage.

* update readme
2020-01-03 11:36:04 +01:00
Joe Haddad
18a9c7e371
Improve linting rules to catch more errors (#9374)
* Update `packages/`

* Update examples

* Update tests

* Update bench

* Update top level files

* Fix build

* trigger
2019-11-10 19:24:53 -08:00
Luis Alvarez D
f10f3304fe Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
Matthew Sweeney
0cd2732c7f
Remove deploy to now button from all examples (#7101) 2019-05-27 12:22:05 -07:00
Connor Davis
3fa04620e7 Remove Deploy To Now buttons (#7126)
* Remove Deploy To Now buttons

* Remove remaining buttons
2019-04-24 10:53:58 +02:00
Juan Olvera
7e12997af6 Test updater script on examples folder (#5993)
I wrote a [script](https://github.com/j0lv3r4/dependency-version-updater) to update dependencies recursively in `package.json` files, e.g.:

```
$ node index.js --path="./examples" --dependencies="react=^16.7.0,react-dom=^16.7.0"
```

This PR contains the result against the examples folder.
2019-01-05 12:19:27 +01:00
Tim Neutkens
9c4eefcdbf
Add prettier for examples directory (#5909)
* Add prettier for examples directory

* Fix files

* Fix linting

* Add prettier script in case it has to be ran again
2018-12-17 17:34:32 +01:00
Jerome Fitzgerald
6eba3ad9ab 🐳️ multistage: remove devDependencies (#5477)
Docker Multistage
* Remove `devDependencies` from `./node_modules`
 in `builder` for faster copy on `base` init

* Added `isomorphic-unfetch` to show it not
 being copied over to `base`.

* `isomorphic-fetch` will still show from `next`
2018-10-19 00:36:04 +02:00
Gerhard Preuss
9634bad79d Remove note on OSS/non-OSS issue (#5474)
I successfully deployed this example with `now` and `now --public` (I am on premium plan).
Did this before deploy

```sh
$ cp Dockerfile.multistage Dockerfile
```
2018-10-18 11:14:17 +02:00
Michael Herold
5b3578e58f #4751 - Explicitly mention install when cloning examples (#4758)
Preferably this installation wouldn't be necessary, but in lieu of a fix...

#4751
2018-07-11 23:56:15 +02:00
yhirano55
b2047de51a Update package.json in with-docker example (#4359)
* Added name, version, license keys.
2018-05-13 18:10:00 +02:00