Skip to content

Commit

Permalink
Merge branch 'canary' into add/plop
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk authored Jan 5, 2022
2 parents ce793a0 + 5680007 commit 976aec1
Show file tree
Hide file tree
Showing 45 changed files with 187 additions and 79 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/build_test_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -698,9 +698,6 @@ jobs:
run: turbo run build-native --cache-dir=".turbo"
env:
MACOSX_DEPLOYMENT_TARGET: '10.13'
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: nextjs
TURBO_PROJECT: nextjs

- name: Upload artifact
uses: actions/upload-artifact@v2.2.4
Expand Down Expand Up @@ -886,9 +883,6 @@ jobs:
run: turbo run build-native --cache-dir=".turbo" -- --release --target ${{ matrix.target }}
env:
MACOSX_DEPLOYMENT_TARGET: '10.13'
TURBO_TOKEN: ${{secrets.TURBO_TOKEN}}
TURBO_TEAM: nextjs
TURBO_PROJECT: nextjs

- name: Upload artifact
uses: actions/upload-artifact@v2.2.4
Expand Down
4 changes: 3 additions & 1 deletion examples/cms-contentful/pages/api/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ export default async function preview(req, res) {
// We don't redirect to req.query.slug as that might lead to open redirect vulnerabilities
// res.writeHead(307, { Location: `/posts/${post.slug}` })
const url = `/posts/${post.slug}`
res.setHeader('Content-Type', 'text/html')
res.write(
`<!DOCTYPE html><html><head><meta http-equiv="Refresh" content="0; url=${url}" />
<script>window.location.href = '${url}'</script>
</head>`
</head>
</html>`
)
res.end()
}
2 changes: 1 addition & 1 deletion examples/with-deta-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"start": "next start"
},
"dependencies": {
"deta": "^0.0.8",
"deta": "^1.0.1",
"next": "latest",
"react": "^17.0.2",
"react-dom": "^17.0.2"
Expand Down
3 changes: 1 addition & 2 deletions examples/with-emotion-vanilla/pages/_document.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import * as React from 'react'
import { renderStatic } from '../shared/renderer'
export default class AppDocument extends Document {
static async getInitialProps(ctx) {
const page = await ctx.renderPage()
const { css, ids } = await renderStatic(page.html)
const initialProps = await Document.getInitialProps(ctx)
const { css, ids } = await renderStatic(initialProps.html)
return {
...initialProps,
styles: (
Expand Down
5 changes: 1 addition & 4 deletions examples/with-next-translate/locales/ar/home.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{
"arabic": "العربية",
"catalan": "الكاتالونية",
"change-arabic": "تغيير اللغة إلى العربية ",
"change-catalan": "تغيير اللغة إلى الكتالانية",
"change-english": "تغيير اللغة إلى اللغة الإنجليزية ",
"change-hebrew": "تغيير اللغة إلى العبرية",
"change-to": "تغيير اللغة إلى",
"description": "ابدأ بالتعديل",
"english": "الإنجليزية",
"hebrew": "العبرية",
Expand Down
5 changes: 1 addition & 4 deletions examples/with-next-translate/locales/ca/home.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{
"arabic": "Àrab",
"catalan": "Català",
"change-arabic": "Canvia a la versió en àrab",
"change-catalan": "Canvia a la versió en català",
"change-english": "Canvia a la versió en anglès",
"change-hebrew": "Canvieu a la versió hebrea",
"change-to": "Canvieu a la versió en",
"description": "Comença editant",
"english": "Anglès",
"hebrew": "Hebreu",
Expand Down
5 changes: 1 addition & 4 deletions examples/with-next-translate/locales/en/home.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{
"arabic": "Arabic",
"catalan": "Catalan",
"change-arabic": "Change language to Arabic",
"change-catalan": "Change language to Catalan",
"change-english": "Change language to English",
"change-hebrew": "Change language to Hebrew",
"change-to": "Change language to",
"description": "Get started by editing",
"english": "English",
"hebrew": "Hebrew",
Expand Down
5 changes: 1 addition & 4 deletions examples/with-next-translate/locales/he/home.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{
"arabic": "עֲרָבִית",
"catalan": "קטלאנית",
"change-arabic": "שנה שפה לערבית",
"change-catalan": "שנה שפה לקטלונית",
"change-english": "שנה שפה לאנגלית",
"change-hebrew": "שנה את השפה לעברית",
"change-to": "שנה את השפה ל",
"description": "התחל על ידי עריכה",
"english": "אנגלית",
"hebrew": "עִברִית",
Expand Down
16 changes: 12 additions & 4 deletions examples/with-next-translate/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,36 @@ export default function Home() {
<Link href="/" locale="en">
<div className="card">
<h3>{t('home:english')}</h3>
<p>{t('home:change-english')}</p>
<p>
{t('home:change-to')} {t('home:english')}
</p>
</div>
</Link>

<Link href="/" locale="ca">
<div className="card">
<h3>{t('home:catalan')}</h3>
<p>{t('home:change-catalan')}</p>
<p>
{t('home:change-to')} {t('home:catalan')}
</p>
</div>
</Link>

<Link href="/" locale="ar">
<div className="card">
<h3>{t('home:arabic')}</h3>
<p>{t('home:change-arabic')}</p>
<p>
{t('home:change-to')} {t('home:arabic')}
</p>
</div>
</Link>

<Link href="/" locale="he">
<div className="card">
<h3>{t('home:hebrew')}</h3>
<p>{t('home:change-hebrew')}</p>
<p>
{t('home:change-to')} {t('home:hebrew')}
</p>
</div>
</Link>

Expand Down
2 changes: 1 addition & 1 deletion examples/with-redis/pages/api/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { v4 as uuidv4 } from 'uuid'

import redis from '../../lib/redis'

export default async function upvote(req, res) {
export default async function create(req, res) {
const { title } = req.body

if (!title) {
Expand Down
2 changes: 1 addition & 1 deletion examples/with-redis/pages/api/features.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import redis from '../../lib/redis'

export default async function upvote(req, res) {
export default async function getAllFeatures(req, res) {
const features = (await redis.hvals('features'))
.map((entry) => JSON.parse(entry))
.sort((a, b) => b.score - a.score)
Expand Down
2 changes: 1 addition & 1 deletion examples/with-redis/pages/api/subscribe.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import redis from '../../lib/redis'

export default async function upvote(req, res) {
export default async function subscribe(req, res) {
const { email } = req.body

if (email && validateEmail(email)) {
Expand Down
3 changes: 3 additions & 0 deletions examples/with-tailwindcss/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
3 changes: 3 additions & 0 deletions examples/with-tailwindcss/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ yarn-error.log*

# vercel
.vercel

# typescript
*.tsbuildinfo
8 changes: 8 additions & 0 deletions examples/with-tailwindcss/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
<p align="center">

<img src="https://res.cloudinary.com/ddcg0rzlo/image/upload/v1640340715/nextjs-tailwind-typescript-banner_vslgq4.png" alt="Next.js TypeScript Starter">

</p>

<br />

# Next.js + Tailwind CSS Example

This example shows how to use [Tailwind CSS](https://tailwindcss.com/) [(v3.0)](https://tailwindcss.com/blog/tailwindcss-v3) with Next.js. It follows the steps outlined in the official [Tailwind docs](https://tailwindcss.com/docs/guides/nextjs).
Expand Down
5 changes: 5 additions & 0 deletions examples/with-tailwindcss/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
4 changes: 4 additions & 0 deletions examples/with-tailwindcss/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
reactStrictMode: true,
}
9 changes: 7 additions & 2 deletions examples/with-tailwindcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@
"react-dom": "^17.0.2"
},
"devDependencies": {
"@types/node": "17.0.4",
"@types/react": "17.0.38",
"autoprefixer": "^10.4.0",
"postcss": "^8.4.4",
"tailwindcss": "^3.0.0"
"eslint": "8.5.0",
"eslint-config-next": "12.0.7",
"postcss": "^8.4.5",
"tailwindcss": "^3.0.7",
"typescript": "4.5.4"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import '../styles/globals.css'
import type { AppProps } from 'next/app'

function MyApp({ Component, pageProps }) {
function MyApp({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />
}

Expand Down
5 changes: 0 additions & 5 deletions examples/with-tailwindcss/pages/api/hello.js

This file was deleted.

13 changes: 13 additions & 0 deletions examples/with-tailwindcss/pages/api/hello.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
import type { NextApiRequest, NextApiResponse } from 'next'

type Data = {
name: string
}

export default function handler(
req: NextApiRequest,
res: NextApiResponse<Data>
) {
res.status(200).json({ name: 'John Doe' })
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function Home() {
<p className="mt-3 text-2xl">
Get started by editing{' '}
<code className="p-3 font-mono text-lg bg-gray-100 rounded-md">
pages/index.js
pages/index.tsx
</code>
</p>

Expand Down
2 changes: 0 additions & 2 deletions examples/with-tailwindcss/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// If you want to use other PostCSS plugins, see the following:
// https://tailwindcss.com/docs/using-with-preprocessors
module.exports = {
plugins: {
tailwindcss: {},
Expand Down
20 changes: 20 additions & 0 deletions examples/with-tailwindcss/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}
2 changes: 1 addition & 1 deletion examples/with-typescript/pages/api/users/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const handler = (_req: NextApiRequest, res: NextApiResponse) => {
}

res.status(200).json(sampleUserData)
} catch (err) {
} catch (err: any) {
res.status(500).json({ statusCode: 500, message: err.message })
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/with-typescript/pages/users/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const getStaticProps: GetStaticProps = async ({ params }) => {
// By returning { props: item }, the StaticPropsDetail component
// will receive `item` as a prop at build time
return { props: { item } }
} catch (err) {
} catch (err: any) {
return { props: { errors: err.message } }
}
}
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "12.0.8-canary.17"
"version": "12.0.8-canary.18"
}
2 changes: 1 addition & 1 deletion packages/create-next-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-next-app",
"version": "12.0.8-canary.17",
"version": "12.0.8-canary.18",
"keywords": [
"react",
"next",
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-next",
"version": "12.0.8-canary.17",
"version": "12.0.8-canary.18",
"description": "ESLint configuration used by NextJS.",
"main": "index.js",
"license": "MIT",
Expand All @@ -9,7 +9,7 @@
"directory": "packages/eslint-config-next"
},
"dependencies": {
"@next/eslint-plugin-next": "12.0.8-canary.17",
"@next/eslint-plugin-next": "12.0.8-canary.18",
"@rushstack/eslint-patch": "^1.0.8",
"@typescript-eslint/parser": "^5.0.0",
"eslint-import-resolver-node": "^0.3.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/eslint-plugin-next",
"version": "12.0.8-canary.17",
"version": "12.0.8-canary.18",
"description": "ESLint plugin for NextJS.",
"main": "lib/index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-bundle-analyzer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/bundle-analyzer",
"version": "12.0.8-canary.17",
"version": "12.0.8-canary.18",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-codemod/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/codemod",
"version": "12.0.8-canary.17",
"version": "12.0.8-canary.18",
"license": "MIT",
"dependencies": {
"chalk": "4.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-env/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/env",
"version": "12.0.8-canary.17",
"version": "12.0.8-canary.18",
"keywords": [
"react",
"next",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-mdx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/mdx",
"version": "12.0.8-canary.17",
"version": "12.0.8-canary.18",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-plugin-storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-storybook",
"version": "12.0.8-canary.17",
"version": "12.0.8-canary.18",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-storybook"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-module/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-module",
"version": "12.0.8-canary.17",
"version": "12.0.8-canary.18",
"description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)",
"main": "dist/polyfill-module.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-nomodule/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-nomodule",
"version": "12.0.8-canary.17",
"version": "12.0.8-canary.18",
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
Expand Down
Loading

0 comments on commit 976aec1

Please sign in to comment.