Commit graph

40 commits

Author SHA1 Message Date
Luis Alvarez D
77150dac79
Include submodules in exported type definition (#28316) 2021-11-26 14:46:56 +01:00
Konstantin Popov
5f38b18b10
Fix minor typos (#31161)
Hello,
I've found some minor typos in the documentation, solved with this PR.
2021-11-08 11:24:53 -06: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
Oscar Busk
25df53d19f
next-env.d.ts note in templates (#27983)
Hello! I was using `npx create-next-app --ts` to quickly bootstrap a basic next.js project with Typescript. It bothered me that I got git diff just from running `npm run build` inside the project, because the new notice in the `next-env.d.ts` file.

![image](https://user-images.githubusercontent.com/13413409/129115266-80e00bf3-78aa-40be-bd0f-a18aaa448a68.png)

So I went ahead and updated the `next-env.d.ts` file in [`packages/create-next-app/templates/typescript`](fb67ce9864/packages/create-next-app/templates/typescript/next-env.d.ts) to be exactly how the file looks after running once. (7417ecc09c)

Then I realized that I could probably do the same for all the `next-env.d.ts` that are spread out in the many examples, to make running those examples after cloning them feel a bit smoother. (fb67ce9864)

> However I skipped the [`with-typescript-graphql`](40f85f6d95/examples/with-typescript-graphql) example since that [`next-env.d.ts`](40f85f6d95/examples/with-typescript-graphql/next-env.d.ts (L4-L9)) actually has changes and I couldn't even run `yarn build` in that example, so I'm not sure what will happen with the `next-env.d.ts`. Someone who _gets_ that example will have to fix it I suppose.
2021-08-12 20:36:53 +00:00
Thang Vu
9fc58f88a2
fix: hydration warning in with-mobx-state-tree-typescript example (#27339)
## Bug

- [x] Related issues linked using `fixes #number` fixes https://github.com/vercel/next.js/issues/27290
- [ ] 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

- [x] Make sure the linting passes
2021-07-20 14:15:02 +00: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
Nick Babcock
5629223407
Update examples to use React 17 (#26133)
[With next 11 requiring react 17](https://nextjs.org/blog/next-11#upgrade-guide), most of the examples
need to be updated, so the following snippet updated all the examples to
a compatible react version.

```bash
cd examples/
fd -g 'package.json' | xargs sed -r -i 's/"react": ".*"/"react": "^17.0.2"/
fd -g 'package.json' | xargs sed -r -i 's/"react-dom": ".*"/"react-dom": "^17.0.2"/'

# exclude experimental react version
git checkout with-reason-relay/package.json
```
2021-06-16 16:43:26 +00:00
Dominic Elm
7530865e45
docs(examples/with-mobx-state-tree-typescript): add 'Open in StackBlitz' button (#25926)
Add `Open in StackBlitz` button to `examples/with-mobx-state-tree-typescript` now that it was fixed in #25589.

## 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
- [x] Example(s) updated
- [ ] Telemetry added. In case of a feature if it's used or not.

## Documentation / Examples

- [x] Make sure the linting passes
2021-06-09 14:03:33 +00:00
Patrick El-Hage
b7cd0a15aa
fix mobx-state-tree-typesript missing babel/core dependency (#25589)
## What
![Screen Shot 2021-05-29 at 12 23 37 PM](https://user-images.githubusercontent.com/4411839/120082909-7d8f0480-c07a-11eb-8d77-f9d8769cfefc.png)
![Screen Shot 2021-05-29 at 12 24 46 PM](https://user-images.githubusercontent.com/4411839/120082913-81228b80-c07a-11eb-86c2-24f12811cd24.png)



## Bug

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

## Feature

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

## Documentation / Examples

- [x] Make sure the linting passes
2021-06-05 18:49:40 +00:00
Luis Alvarez D
e28fd50441
Include utm_source on example links to vercel.com (#21305) 2021-01-19 07:28:54 +00:00
Luc Leray
8eaabe2fb0
Fix deploy buttons URLs (#20834)
Fix all deploy button URLs in the Next.js repo to follow the following format:
```
https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/<EXAMPLE_NAME>&project-name=<EXAMPLE_NAME>&repository-name=<EXAMPLE_NAME>
```

The detailed docs for the Deploy Button can be found here: https://vercel.com/docs/more/deploy-button.

Also updates legacy Vercel import flow URLs (starting with vercel.com/import or with vercel.com/new/project), to use the new vercel.com/new URLs.

---

For example, for the `hello-world` example:

The URL is https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/hello-world&project-name=hello-world&repository-name=hello-world

And the deploy button looks like this:
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/hello-world&project-name=hello-world&repository-name=hello-world)

---

For reference, I used the following regexes to search for the incorrect URLs

```
\(https://vercel.com/import/git\?s=https://github.com/vercel/next.js/tree/canary/examples/(.*)\)
\(https://vercel.com/import/git\?c=1&s=https://github.com/vercel/next.js/tree/canary/examples/([^&]*)(.*)\)
\(https://vercel.com/import/project\?template=https://github.com/vercel/next.js/tree/canary/examples/(.*)\)
https://vercel.com/import/git
https://vercel.com/import/select-scope
https://vercel.com/import
https://vercel.com/new/project
```
2021-01-07 01:40:29 +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
kevin sproles
5e9f3102b8
Update MST typescript example to use hooks (#15237)
1. Switched from class components to functional components with hooks (https://reactjs.org/docs/hooks-effect.html)
2. Removed inject pattern (which is obsolete) in favor of hooks (https://mobx-react.js.org/recipes-migration)
3. Switched to mobx-react-lite
2020-07-17 18:42:36 +00: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
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
Joe Haddad
86160a5190
Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
Tim Neutkens
483bd3ddda
Rename ZEIT to Vercel (#12075)
* Find/replace

* Update more URLs

* More rename

* Fix remaining examples

* More updates

* Update create-next-app

* Update remaining text

* Update

Co-authored-by: Shu Uesugi <shu@chibicode.com>
2020-04-21 11:47:12 +02:00
Luis Alvarez D
282f375189
[Examples] Update with-mobx-state-tree examples (#11736)
* Updated with-mobx-state-tree

* Updated with-mobx-state-tree-typescript

* minor fix
2020-04-08 09:44:28 +02:00
Shu Uesugi
c57cdbb31d
Rename zeit.co/new → zeit.co/import (#10674)
* Replace zeit.co/new → zeit.co/import

* Update deployment.md
2020-02-24 19:08:34 -05:00
Shu Uesugi
5f041447bc
Remove Now CLI reference from examples (#10501)
* Find/Replace "Deploy it to the cloud..."

* Find/Replace "Deploy it to the cloud..." (no colon)

* Find/Replace "Deploy it to the cloud..." for firebase

* Convert remaining ones

* Storybook deployment

* Update with-stripe-typescript

* Update contributing.md

* Remove `now`

* Update examples/with-stripe-typescript/README.md

Co-Authored-By: Luis Alvarez D. <luis@zeit.co>
2020-02-12 17:14:57 -05: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
Luis Alvarez D
7edf0da0c4 Add the deploy button to compatible examples (#9547) 2019-11-27 11:40:58 -05:00
Luis Alvarez D
f10f3304fe Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
Tim Neutkens
a90a55545b
Deprecate Container usage (#8327)
* Remove Container from examples

* Update readme to reflect Container removal
2019-08-11 22:02:33 +02:00
Luis Fernando Alvarez D
8c5209efab Update typescript examples (#7867)
* Updated with-jest-typescript

* Updated the mobx-state-tree-typescript example

* Removed the sitemap with typescript example

* Updated the with css typings example
2019-07-10 12:51:21 +02:00
Joe Haddad
b3170d2648
Format missed files (#7464)
* Format missed files

* Remove unnecessary rule

* Fix type error
2019-05-29 18:19:32 -07:00
Tim Neutkens
3e51ddb8af
Move syntax formatting to prettier (#7454)
* Run prettier over packages/**/*.js

* Run prettier over packages/**/*.ts

* Run prettier over examples

* Remove tslint

* Run prettier over examples

* Run prettier over all markdown files

* Run prettier over json files
2019-05-29 13:57:26 +02: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
Corbin Crutchley
c120d6b9fb Fastify example dep update (#6714)
This merge request updates `fastify` package from v1 to v2 and adds the `cross-env` package so `NODE_ENV=` can work on Windows as well as OSX/Linux. Also adds example build output to GITIGNORE

Worth mentioning that pressing `a` will bring up a page that says `b` and vice-versa, but this seems to be the logic from the previous example as well. Can change if wanted
2019-04-03 11:56:39 +02:00
Jehun Seem(심제훈)
ce329cce96 Fix with-mobx-state-tree-typescript modules export (#6704)
* Update libraries

* Fix for export modules for type
2019-03-19 11:43:12 +01:00
k-kawakami
d9060f5abd Remove trailing spaces (#6547)
### changes
#### remove trailing spaces

When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.

`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tslint error occurs at commit.
2019-03-07 17:40:08 +01: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
Don Alvarez
af9214b302 mobx-state-tree examples should use _app (#5362)
The mobx-state-tree examples (with and without typescript) pre-dated the next _app class and needed to be updated to use _app for persisting state across client-side navigation transitions. Also removed unneeded custom server class to better keep with the "show one feature per example" style of the next examples folder
2018-10-14 10:04:58 +02:00
Henrik Wenz
f0f8229009 Update with-mobx-state-tree-typescript example (#5266)
To work with babel7 & next7.
2018-09-27 16:39:11 +02:00
Ian Mitchell
0e4d2a15a7 Fix Example Deploy Links (#5216) 2018-09-20 11:32:16 +02:00
Don Alvarez
d4a54b6122 Add with-mobx-state-tree-typescript example (re-submitting due to accidental deletion) (#5077)
I think I accidentally deleted the branch my prior PR was based on before you had a chance to merge or decide whether to merge. In case I borked things with that delete, I'm resubmitting the PR and figuring you can close one or the other or both as desired.

Original notes:

Based on with-mobx-state-tree, but typescript instead of javascript

Aside from a few bits of typing and renaming .js files to .ts and .tsx, most of the the edits are to avoid warnings and errors when running the code through tslint (which can be done via the `npm run tslint` command in the example if desired).

To keep this example simple, the `<styled>` component (which is used by the javascript-based with-redux and with-mobx-state-tree examples for the clock component) is not used in this example. The `<styled>` library can of course be used with typescript but (I think) it requires a more complicated set of typescript and babel .configs than is needed for most other components and libraries, so I'm just directly styling the one formerly `<styled>` div to keep things simple and broadly applicable.
2018-09-04 17:17:30 +02:00