Skip to content

Commit

Permalink
Merge branch 'canary' into leyan/blog
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Mar 8, 2022
2 parents 5b3f81c + 8d0561e commit cb039b5
Show file tree
Hide file tree
Showing 157 changed files with 5,428 additions and 790 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"jsx": true
},
"babelOptions": {
"presets": ["@babel/preset-env", "@babel/preset-react"],
"presets": ["next/babel"],
"caller": {
// Eslint supports top level await when a parser for it is included. We enable the parser by default for Babel.
"supportsTopLevelAwait": true
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build_test_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,10 @@ jobs:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}-${{ github.run_attempt }}

- uses: pnpm/action-setup@v2.2.1
with:
version: 6.32.2

- uses: actions/download-artifact@v2
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
with:
Expand Down
1 change: 1 addition & 0 deletions docs/api-reference/create-next-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ yarn create next-app --typescript
- **-e, --example [name]|[github-url]** - An example to bootstrap the app with. You can use an example name from the [Next.js repo](https://github.com/vercel/next.js/tree/canary/examples) or a GitHub URL. The URL can use any branch and/or subdirectory.
- **--example-path [path-to-example]** - In a rare case, your GitHub URL might contain a branch name with a slash (e.g. bug/fix-1) and the path to the example (e.g. foo/bar). In this case, you must specify the path to the example separately: `--example-path foo/bar`
- **--use-npm** - Explicitly tell the CLI to bootstrap the app using npm. To bootstrap using yarn we recommend running `yarn create next-app`
- **--use-pnpm** - Explicitly tell the CLI to bootstrap the app using pnpm. To bootstrap using yarn we recommend running `yarn create next-app`

### Why use Create Next App?

Expand Down
2 changes: 1 addition & 1 deletion docs/routing/shallow-routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ componentDidUpdate(prevProps) {

## Caveats

Shallow routing **only** works for same page URL changes. For example, let's assume we have another page called `pages/about.js`, and you run this:
Shallow routing **only** works for URL changes in the current page. For example, let's assume we have another page called `pages/about.js`, and you run this:

```jsx
router.push('/?counter=10', '/about?counter=10', { shallow: true })
Expand Down
2 changes: 1 addition & 1 deletion docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ Run `npm run build` and `npm run start`, then run `npm run test:e2e` in another
### Running Playwright on Continuous Integration (CI)

Playwright will by default run your tests in the [headless mode]https://playwright.dev/docs/ci#running-headed). To install all the Playwright dependencies, run `npx playwright install-deps`.
Playwright will by default run your tests in the [headless mode](https://playwright.dev/docs/ci#running-headed). To install all the Playwright dependencies, run `npx playwright install-deps`.

You can learn more about Playwright and Continuous Integration from these resources:

Expand Down
9 changes: 8 additions & 1 deletion examples/blog-starter/components/avatar.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import Image from 'next/image'
export default function Avatar({ name, picture }) {
return (
<div className="flex items-center">
<img src={picture} className="w-12 h-12 rounded-full mr-4" alt={name} />
<Image
src={picture}
width={48}
height={48}
className="w-12 h-12 rounded-full mr-4"
alt={name}
/>
<div className="text-xl font-bold">{name}</div>
</div>
)
Expand Down
2 changes: 1 addition & 1 deletion examples/blog-starter/components/cover-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function CoverImage({ title, src, slug, height, width }) {
return (
<div className="sm:mx-0">
{slug ? (
<Link as={`/posts/${slug}`} href="/posts/[slug]">
<Link href={`/posts/${slug}`}>
<a aria-label={title}>{image}</a>
</Link>
) : (
Expand Down
2 changes: 1 addition & 1 deletion examples/blog-starter/components/hero-post.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function HeroPost({
<div className="md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 mb-20 md:mb-28">
<div>
<h3 className="mb-4 text-4xl lg:text-6xl leading-tight">
<Link as={`/posts/${slug}`} href="/posts/[slug]">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
</Link>
</h3>
Expand Down
2 changes: 1 addition & 1 deletion examples/blog-starter/components/post-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function PostPreview({
/>
</div>
<h3 className="text-3xl mb-3 leading-snug">
<Link as={`/posts/${slug}`} href="/posts/[slug]">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
</Link>
</h3>
Expand Down
6 changes: 3 additions & 3 deletions examples/blog-starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"remark-html": "15.0.1"
},
"devDependencies": {
"autoprefixer": "^10.4.0",
"postcss": "^8.4.4",
"tailwindcss": "^3.0.1"
"autoprefixer": "^10.4.2",
"postcss": "^8.4.7",
"tailwindcss": "^3.0.23"
}
}
34 changes: 34 additions & 0 deletions examples/cms-tina/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel
1 change: 1 addition & 0 deletions examples/cms-tina/.tina/__generated__/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cb039b5

Please sign in to comment.