Commit graph

52 commits

Author SHA1 Message Date
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
francismarcus
05e8b38e16 Updated packages for examples/with-typescript (#9791)
* Update packages

* Update examples/with-typescript/package.json

Co-Authored-By: JJ Kasper <jj@jjsweb.site>

* Run lint-fix

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2019-12-19 16:13:04 -06:00
Luis Alvarez D
7edf0da0c4 Add the deploy button to compatible examples (#9547) 2019-11-27 11:40:58 -05:00
Joe Haddad
6b54e9ed66 Fix Prettier Commit Hook (#9245)
* Apply format to webpack config

* hit all files
2019-10-30 12:35:51 +01:00
Resi Respati
42bf21091e [with-typescript] Updated TypeScript example to use API routes (#9073)
* [with-typescript] Updated TypeScript example to use API routes

Next.js 9.0.0 has been out for a while, which supports API routes, but
the examples were never updated to make use of it. This PR adds a simple
example of an API route which also makes use of dynamic routing.

A simple `fetch()` wrapper is also added for example purposes, and the
pages structure have also been updated to dynamic routing.

* Properly link to the dynamic page
2019-10-16 13:38:14 -05:00
Luis Alvarez D
f10f3304fe Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
takehiro-takahashi
0410a43d5a update package (#8906) 2019-09-29 20:39:32 +02:00
Lukáš Huvar
7863b60ef6 Prettier fix (#8754) 2019-09-16 15:24:42 +02:00
Joe Haddad
aac5121466
Apply missing formatting (#8079)
* Reapply missing formatting

* Fix lint
2019-07-23 14:33:49 -04:00
Rakan Nimer
f406bd9668
Add .gitignore (#7893) 2019-07-16 12:35:26 -04:00
Joe Haddad
5205695578
Switch all examples to next@latest (#7806) 2019-07-08 18:41:33 -04:00
Lukáš Huvar
830281fecd Update typescript example (#7684) 2019-06-27 13:50:38 +02:00
Joe Haddad
353e505172
Fix TypeScript typings (#7648)
* Fix TypeScript typing
This correctly defines `process.browser` instead of `process.env.browser`.

It also removes `process.crossOrigin` because it's not found in our documentation anywhere and is mostly used for internal purposes.

* Make sure `process.browser` doesn't throw a type error

* Split globals from Next.js module

* Allow `test` as a valid NODE_ENV

* Fix type assignment

* Make sure global types get published

* Fix test
2019-06-24 14:26:17 -04:00
Joe Haddad
8e3c5c2be0
Improve TypeScript package install experience (#7548)
This change will prompt the user about missing packages using the same DX instead of two separate code paths.
2019-06-10 10:53:35 -04:00
Luc
3b5f18495b Replace recursive-copy with own implementation (#7263)
* replace recursive-copy with own implementation

* update yarn.lock

* do not filter out not directories

* do not fail if folder already exists

* replace `\` by `/` when sending pathes to filter

* use fs-extra only in tests

* investigate and test recursive-copy npm module

* improve test by creating fixtures programmatically

* remove recursive-copy npm module test

* add recursive-copy to bench

* add bench:recursive-copy script

* fix Sema import in recursive-copy.ts

* small improvements
2019-06-06 12:33:11 +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
Resi Respati
28b020538a [with-typescript] Remove obsolete TypeScript plugin and updated readme (#7368)
* [with-typescript] Remove obsolete TypeScript plugin and update readme
2019-05-21 12:30:17 -05:00
Resi Respati
a275ad0922 Updated typescript examples (#7337)
* Updated with-typescript example
2019-05-15 21:04:08 -05:00
Lukáš Huvar
d7152f6ae4 Update typescript example to reflects out of box usage (#7235) 2019-05-14 13:31:46 -05: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
Resi Respati
3746d7d90b [with-typescript] Fixed incorrect query type (#6238) 2019-02-11 10:32:10 +01:00
Resi Respati
f8a80f1aa9 [with-typescript] remove unnecessary passHref in Link components (#6233)
As per discussion in #6165, I removed the `passHref` in `Link` as
they're unnecessary.
2019-02-11 00:00:05 +01:00
Resi Respati
8fdb133903 [with-typescript] Improved intial props examples, added example detail (#6165)
I've just thought of a way to improve the initial props page by adding
an example for a list/detail page structure. To do that, I've created a
separate `/detail` page, and a mock API which calls data from the array
we made on the previous PR.

A ListDetail component is created as an example for displaying detail.

Page structure is also cleaned up. Should I go ahead and add an example
on how to style with styled-jsx + its TS declarations? I might decide to
do it within this week anyway.
2019-01-31 17:36:02 +00:00
Resi Respati
6d41ed7e6f [with-typescript] Updated typescript and removed unused deps (#6116)
I've updated the TypeScript dependency to the latest version. Also
removed some dependencies that may not be needed.

I've also fixed tslint errors which may have appeared because of
previous updates to this starter kit, as well as added comments
to explain some parts of the code.
2019-01-24 10:18:43 +01:00
Justin Noel
d6ec10a4bf add new nextjs typings with samples (#6102)
The current `examples/with-typescript` is not using the latest type definitions currently available on DefinitelyTyped project for next.

Added new list page examples that demonstrate how to use the new Types for both stateless functional components and classes.  Also modified examples for list to demonstrate typings for `getInitialProps`.
2019-01-23 12:37:09 +01:00
Peter Kellner
3a3347dc5f The current TypeScript "with-typescript" looks like it was put there as a place holder. I'm fairly new to TypeScript but I'm sure the changes I've made here will be a huge improvement. Open to suggestions and to update as appropriate. Also, Tried to run yarn lint --fix to no avail. I can't figure out how to get it to find lint whether I'm running on my mac or PC. I tried lots of variations around npm i lint -g but had no success. (#6011) 2019-01-08 22:29:58 +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
Anton Moiseev
58583a2b81 Examples: fix <title> warning in the TypeScript example (#5549)
* Replace _document.tsx example with _app.tsx

* Fix title

* Remove _app.tsx
2018-10-29 19:32:01 +01:00
Duncan L
d141b95603 Examples: Update with-typescript Example Packages (#5410)
Update packages for with-typescript example
2018-10-09 12:48:27 +02:00
Resi Respati
397daece42 with-typescript example updates (#5267)
* [with-typescript] Updated `@zeit/next-typescript` and typescript typings

* [with-typescript] Updated tsconfig to match new recommended config

* [with-typescript] upgraded dependencies, implement type-checking

* [with-typescript] add _document example, fixed tsconfig

* [with-typescript] updated README

* [with-typescript] updated example contents

* [with-typescript] adopt the Layout component from Flow example
2018-09-26 09:58:36 +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
jhartley218
ad2d4432e7 Update @types/next to latest in typescript example. (#4750)
Updating to a more recent version of `@types/next` fixes an error I encountered while building a new app on top of the "with-typescript" example:

`Property `push` not found in SingletonRouter`

Additional context: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/26665

To test, add a simple Router.push operation to the `pages/index.tsx`

```
import Router from 'next/router'
// ...
<span onClick={() => Router.push({ pathname: '/about' })}>TEST</span>
```
2018-07-09 13:32:52 +02:00
Vinicius Pacheco Furtado
de6bf4e75f Fix typescript examples (#4704)
Update @zeit/next-typescript version on examples using it
2018-06-30 22:23:38 +02:00
Luke Barton
cbfdcce32d Update typescript examples to use 1.0.1 of next-typescript (#4472)
* Update typescript examples to use 1.0.1 of next-typescript

* Add .babelrc modifications to upgraded typescript examples
2018-05-25 11:28:35 +02:00
yhirano55
ee1b6d93ce Minor improve with-typescript example [ci skip] (#4402)
* Added license to package.json.
* Modified package name same as dir name.
2018-05-17 12:45:13 +02:00
Tim Neutkens
2c3f40600c Upgrade with-typescript to use latest next-typescript 2018-05-12 13:59:15 +02:00
Volker Rose
aec4c00214 Update next-typescript to latest version 0.1.1 (#4176)
This example gave me 404s on `pages/*.tsx` when using it with the latest nextjs (`5.1.0`) and `@zeit/next-typescript@0.0.11`. The latest next-typescript plugin version fixes it.
2018-05-08 17:38:21 +02:00
James Hegedus
f2e56609cd Examples: stabalise README format and create-next-app usage (#4009)
* Examples: clarify language around Yarn create & npx

* add missing READMEs and create-next-app usage

* suggest people tag jthegedus in firebase related issues

* add yarn alt instructions

* cerebraljs example readme & fixes
2018-04-03 14:19:05 +02:00
Tim Neutkens
69ca73ca56 Upgrade @zeit/next-typescript in with-typescript example (patch) 2018-03-30 00:07:33 +02:00
James Hegedus
b1d8b839dd Examples: use npx and yarn create to run create-next-app on examples (#4002)
* remove global npm install of create-next-app

* add npx to create-next-app command in examples

* add bash to shell snippets

* add yarn create to next-app command in examples

* fix READMEs named with lowercase

* change READMEs to use UPPERCASE
2018-03-14 09:09:46 +01:00
Alexander Kachkaev
97aef52def Update tsconfig.json in with-typescript example (#3837)
Fixes https://github.com/zeit/next.js/pull/3698#issuecomment-366442816
2018-02-18 12:42:22 +01:00
Bonggyun Lee
87ab61eba5 example/with-typescript (#3698)
* example/with-typescript2

* apply standard js style

* remove unnecessary file & code

* fix link url

* replace with-typescript
2018-02-06 11:06:48 -05:00
Tim Neutkens
24c1ac6ca9
Use canary for all example downloads (#3411) 2017-12-06 18:12:42 -08:00
Giuseppe
5daafa4f87 Upgrade styled-jsx to v2.2.1 (#3358)
* Pulled encoding to top of head (#3214)

* Remove next.d.ts to use @types/next (#3297)

* Add with-mobx-state-tree example (#3179)

* Adapt with-mobx example for with-mobx-state-tree

* Remove unnecessary lastUpdate parameter to show off snapshot

* update readme

* make other.js more closely mimic index.js

* Upgrade styled-jsx to v2.2.1

Includes some bug fixes.

* Fix linting
2017-12-04 08:15:30 -08:00
Fouad Matin
2528779394 examples: add create-next-app (#3377)
* examples: add create-next-app

* fix with-typescript readme
2017-12-02 20:30:17 -08:00
Brice BERNARD
45e26f22b3 Fix tsx workaround, bootstrap next.d.ts, add tslint deps (#2885) 2017-11-13 13:59:00 +01:00
Kohei Hasegawa
63ac27b900 Update TypeScript example (#3074) 2017-10-11 21:36:04 +02:00
Sagi
ab82f06c87 Added react and react-dom dependencies (#2518)
* Added react and react-dom dependencies

Added missing `react` and `react-dom` dependencies which are required by next.js

* Moved react & react-dom to dependencies

Moved react & react-dom to dependencies from devDependencies
2017-07-09 15:26:35 +02:00
Henrik
f14297dc80 Normalize example package.json files (#2350) 2017-06-23 10:46:44 +02:00