Commit graph

37 commits

Author SHA1 Message Date
Balázs Orbán
335e91800b
chore(examples): remove next-env.d.ts files (#41041)
They are added to `.gitignore` already. Follow-up on #39051


## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a 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 a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-09-29 16:39:47 -07:00
Marcos Bérgamo
c3e5caf110
docs(examples): improve DX while copying command to create new project (#38410)
* docs(examples): improve DX while copy command to create new project

* chore: apply code review

Co-authored-by: Marcos Bérgamo <Marcos.Bergamo@refinitiv.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-07-26 21:57:48 -05:00
JJ Kasper
0ab6ad5241
Update default gitignore templates (#39051) 2022-07-26 20:08:40 -05:00
Han Yeong-woo
4d8d99e47e
chore(example): convert with-stitches to TS (#38892)
* chore(example): convert `with-stitches` to TS

* refactor: change arrow to declaration

* refactor: change import default to `* as`

* feat: add next.config.js

* refactor: improve typing

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-07-22 11:02:53 -05:00
Steven
57dcc9d329
Update pnpm create next-app for latest pnpm 6 and 7 (#37254)
This command changed in pnpm [6.32.13](https://github.com/pnpm/pnpm/releases/tag/v6.32.13) and [7.1.1](https://github.com/pnpm/pnpm/releases/tag/v7.1.1) so lets update it since its been a few weeks and we can expect pnpm users to update more regularly than npm users.

- Fixes https://github.com/vercel/next.js/pull/37240 
- Fixes https://github.com/vercel/next.js/pull/37045
- Fixes https://github.com/vercel/next.js/pull/37032
- Fixes https://github.com/vercel/next.js/pull/36602
- Fixes https://github.com/vercel/next.js/pull/36496
2022-05-27 21:21:40 +00:00
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
Hassan El Mghari
33aa51ab26
Change README structure in examples (#35349)
Changed the README structure in all examples to take out the Stackblitz button and include it as a link instead using a [bash script](https://gist.github.com/Nutlope/a8f3556a5a401e32a8c6278b782ebf8a/revisions).

I also added the Vercel deploy button to 15 READMEs that didn't have it.
2022-03-16 21:39:26 +00:00
Tuan Nguyen
a410155b93
Upgrade to @stitches/react 1.2.6 (#33817) 2022-01-30 23:42:43 +00:00
Rob Easthope
e0b384929c
with-stitches example fixes #28650 (#28652)
The with-stitches example is broken presumably due to changes in the Stitches API now that it's hit `1.0.0`. I've created an issue already: #28650 

I've made three small changes:
- Replaced the createCss function in `stitcheds.config.js` with createStitches
- Replaced the getCssString function with getCssText  in `stitches.config.js` and `pages/_documents.jsx`
- Bumped `@stitches/react` to `^1.0.0` 🎉

I've left the rest of the example code alone as I'm still exploring the library after seeing yesterdays release annoucement.

@peduarte Is there anything else that needs to updated?
2021-09-07 02:14:32 +00:00
JJ Kasper
5544adc481
Update to latest babel versions (#28174) 2021-08-17 09:18:08 +02: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
JJ Kasper
c082972b93
Continue: fix typo in breakpoint config (#27313) 2021-07-19 19:00:14 -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
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
d2caaeab64
docs: add 'Open in StackBlitz' buttons to various examples (#25853)
This PR adds a `Preview` section and a `Open in StackBlitz` button to various examples. I have tested all examples and omitted the ones that require third party API keys, or didn't work. Some examples don't work locally either.

Here's an example:
![image](https://user-images.githubusercontent.com/12571019/121027783-88971280-c7a7-11eb-851a-0ad30cf74b42.png)

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

## Documentation / Examples

- [x] Make sure the linting passes
2021-06-08 20:45:02 +00:00
Pedro Duarte
1afcf67c0f
with-stitches Fix Stitches config (#23394)
This PR fixes the Stitches config. 

Thanks!

## Documentation / Examples

- [x] Make sure the linting passes
2021-03-25 14:40:05 +00:00
Pedro Duarte
3141b6ff70
with-stitches: Use latest version (#23343)
Hey 👋 

I realise neither I or you want to keep reviewing and merging these "Update Stitches" PRs

So I'm setting it to the `latest`.

Thanks (and sorry)

## Documentation / Examples

- [x] Make sure the linting passes
2021-03-24 14:07:36 +00:00
Pedro Duarte
873cd8355f
Update with stitches example (#23326)
Hey 👋 

Just a quick update to the latest version of Stitches. 

Thanks! <3

## Documentation / Examples

- [x] Make sure the linting passes
2021-03-23 22:21:04 +00:00
Pedro Duarte
2ef00a3c4a
Update with-stitches example (#23281)
## Examples

- [x] Make sure the linting passes

This PR updates the `with-stitches` example to use the Beta `0.1.0` release.
2021-03-22 21:29:58 +00:00
Robin
c47f3d84c4
Unify installation scripts for example apps (#19808) 2021-01-24 17:05:49 +01: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
Pedro Duarte
0e843e6001
Update with-stitches example (#16827)
Hi 👋 

[Stitches](https://stitches.dev) `v0.0.1` beta was recently released. This PR updates the existing examples to the latest packages and API.

Notes:
- Remove `with-stitches-styled` example, that's no longer needed
- Update `with-stitches` example
  - Update dependency
  - Example done with Typescript
- Updated README

Thanks ✌️ 

![CleanShot 2020-09-03 at 18 23 09@2x](https://user-images.githubusercontent.com/372831/92141867-52d98d80-ee13-11ea-91ed-001cd46989f1.jpg)
2020-09-03 17:38:13 +00:00
Joe Haddad
f17d435166
Ensure all examples are MIT licensed (#16691) 2020-08-29 22:32:35 -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
Christian Alfoni
e5f2a05bf5
Update _document.js (#14937)
Fix key warning
2020-07-07 14:20:17 -05:00
Christian Alfoni
d80b46d814
Update package.json (#14938) 2020-07-07 14:20:05 -05:00
Christian Alfoni
974cae686e
Update example: update to new stitches version and api (#14876) 2020-07-07 04:17:07 +00:00
Luis Alvarez D
43271821f2
[Examples] Move with-typescript-graphql to SSG (#13854)
Related to https://github.com/vercel/next.js/issues/11014
2020-06-10 04:14:53 +00:00
Joe Haddad
4a12fb0a5f
Normalize example gitignores (#13768)
This removes a bunch of unnecessary `.gitignore`s and fixes some CMS examples that don't ignore `node_modules` etc.
2020-06-04 20:39:52 +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
db5b5a76a8
Update some examples to Vercel (#13477)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-05-28 13:32:29 +02:00
Joe Haddad
b7e17e09e5
Update references to zeit/next.js (#13463) 2020-05-27 17:51:11 -04:00
TodorTotev
8618ab85ad
More redundant imports @ examples (#13190)
Again, related to [12964](https://github.com/zeit/next.js/issues/12964)

After checking all the other examples and the ongoing pull requests, I believe that with this PR being merged, all the examples should be free of redundant react imports.
Let me know if you want me to edit anything that you don't like.

Regards

with-typescript
with-atstroturf
with-atlaskit
with-styletron
with-styled-components-rtl
with-stylesheet
with-stomp
with-stitches-styled
with-stitches
with-slate
with-sentry-simple
with-sentry
with-segment-analytics
with-rematch
with-relay-modern
with-reflux
with-redux-wrapper
with-react-relay-network
with-react-native
with-react-multi-carousel
with-react-jss
with-react-helmet
with-react-ga
with-quill-js
with-prefetching
with-google-analytics-amp
with-google-analytics
with-framer-motion
with-flow
with-firebase-hosting
with-firebase-cloud-messaging
with-firebase-authentication
with-expo
with-dynamic-app-layout
with-draft-js
with-cxs
with-cerebral
with-ant-design-mobile
with-algolia-react-instantsearch
using-preact
progressive-render
2020-05-22 15:33:04 +00:00
Christian Alfoni
cc9e2526e4
With stitches (#12677)
split into two examples
2020-05-20 06:22:50 +00:00
Joe Haddad
86160a5190
Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
Christian Alfoni
a6791abf9c
example: new with-stitches (#11924) 2020-05-02 00:30:39 -04:00