Skip to content

Commit

Permalink
Merge branch 'canary' into next-dynamic-swc-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Nov 26, 2021
2 parents 5c56281 + 77150da commit c70afd1
Show file tree
Hide file tree
Showing 33 changed files with 22 additions and 39 deletions.
1 change: 0 additions & 1 deletion examples/blog-starter-typescript/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
1 change: 0 additions & 1 deletion examples/custom-server-typescript/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
1 change: 0 additions & 1 deletion examples/with-aws-amplify-typescript/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
1 change: 0 additions & 1 deletion examples/with-chakra-ui-typescript/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
1 change: 0 additions & 1 deletion examples/with-expo-typescript/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
1 change: 0 additions & 1 deletion examples/with-ionic-typescript/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
1 change: 0 additions & 1 deletion examples/with-iron-session/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
1 change: 0 additions & 1 deletion examples/with-jotai/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
1 change: 0 additions & 1 deletion examples/with-mobx-state-tree-typescript/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
1 change: 0 additions & 1 deletion examples/with-mysql/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
1 change: 0 additions & 1 deletion examples/with-next-sitemap/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
1 change: 0 additions & 1 deletion examples/with-paste-typescript/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
1 change: 0 additions & 1 deletion examples/with-react-intl/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
1 change: 0 additions & 1 deletion examples/with-react-md-typescript/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
1 change: 0 additions & 1 deletion examples/with-redux/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
1 change: 0 additions & 1 deletion examples/with-reflexjs/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
1 change: 0 additions & 1 deletion examples/with-storybook-styled-jsx-scss/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
1 change: 0 additions & 1 deletion examples/with-stripe-typescript/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
1 change: 0 additions & 1 deletion examples/with-temporal/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
1 change: 0 additions & 1 deletion examples/with-typescript-eslint-jest/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
1 change: 0 additions & 1 deletion examples/with-typescript-graphql/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
1 change: 0 additions & 1 deletion examples/with-typescript-styled-components/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
1 change: 0 additions & 1 deletion examples/with-typescript-types/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
1 change: 0 additions & 1 deletion examples/with-typescript/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
1 change: 0 additions & 1 deletion examples/with-unsplash/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
16 changes: 16 additions & 0 deletions packages/next/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/// <reference types="./types/global" />
/// <reference path="./amp.d.ts" />
/// <reference path="./app.d.ts" />
/// <reference path="./config.d.ts" />
/// <reference path="./document.d.ts" />
/// <reference path="./dynamic.d.ts" />
/// <reference path="./error.d.ts" />
/// <reference path="./head.d.ts" />
/// <reference path="./image.d.ts" />
/// <reference path="./link.d.ts" />
/// <reference path="./router.d.ts" />
/// <reference path="./script.d.ts" />
/// <reference path="./server.d.ts" />

export { default } from './types'
export * from './types'
2 changes: 0 additions & 2 deletions packages/next/lib/typescript/writeAppTypeDeclarations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ export async function writeAppTypeDeclarations(
const content =
'/// <reference types="next" />' +
eol +
'/// <reference types="next/types/global" />' +
eol +
(imageImportsEnabled
? '/// <reference types="next/image-types/global" />' + eol
: '') +
Expand Down
3 changes: 2 additions & 1 deletion packages/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"repository": "vercel/next.js",
"bugs": "https://github.com/vercel/next.js/issues",
"homepage": "https://nextjs.org",
"types": "types/index.d.ts",
"types": "index.d.ts",
"files": [
"dist",
"app.js",
Expand Down Expand Up @@ -44,6 +44,7 @@
"jest.d.ts",
"amp.js",
"amp.d.ts",
"index.d.ts",
"types/index.d.ts",
"types/global.d.ts",
"image-types/global.d.ts"
Expand Down
2 changes: 1 addition & 1 deletion test/lib/next-modes/next-dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class NextDevInstance extends NextInstance {
shell: false,
env: {
...process.env,
NODE_ENV: '',
NODE_ENV: '' as any,
__NEXT_TEST_MODE: '1',
__NEXT_RAND_PORT: '1',
__NEXT_TEST_WITH_DEVTOOL: '1',
Expand Down
2 changes: 1 addition & 1 deletion test/lib/next-modes/next-start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class NextStartInstance extends NextInstance {
shell: false,
env: {
...process.env,
NODE_ENV: '',
NODE_ENV: '' as any,
__NEXT_TEST_MODE: '1',
__NEXT_RAND_PORT: '1',
},
Expand Down
4 changes: 2 additions & 2 deletions test/unit/babel-plugin-next-ssg-transform.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const trim = (s) => s.join('\n').trim().replace(/^\s+/gm, '')

// avoid generating __source annotations in JSX during testing:
const NODE_ENV = process.env.NODE_ENV
process.env.NODE_ENV = 'production'
;(process.env as any).NODE_ENV = 'production'
const plugin = require('next/dist/build/babel/plugins/next-ssg-transform')
process.env.NODE_ENV = NODE_ENV
;(process.env as any).NODE_ENV = NODE_ENV

const babel = (code, esm = true, pluginOptions = {}) =>
transform(code, {
Expand Down
6 changes: 0 additions & 6 deletions test/unit/write-app-declarations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ describe('find config', () => {
const content =
'/// <reference types="next" />' +
eol +
'/// <reference types="next/types/global" />' +
eol +
(imageImportsEnabled
? '/// <reference types="next/image-types/global" />' + eol
: '') +
Expand All @@ -39,8 +37,6 @@ describe('find config', () => {
const content =
'/// <reference types="next" />' +
eol +
'/// <reference types="next/types/global" />' +
eol +
(imageImportsEnabled
? '/// <reference types="next/image-types/global" />' + eol
: '') +
Expand All @@ -62,8 +58,6 @@ describe('find config', () => {
const content =
'/// <reference types="next" />' +
eol +
'/// <reference types="next/types/global" />' +
eol +
(imageImportsEnabled
? '/// <reference types="next/image-types/global" />' + eol
: '') +
Expand Down

0 comments on commit c70afd1

Please sign in to comment.