Skip to content

Commit

Permalink
Merge branch 'canary' of https://github.com/vercel/next.js into ducan…
Browse files Browse the repository at this point in the history
…hgh-fix-hostnames
  • Loading branch information
timneutkens committed Aug 13, 2023
2 parents 24250b3 + 261db49 commit c0d5fae
Show file tree
Hide file tree
Showing 644 changed files with 25,710 additions and 16,117 deletions.
3 changes: 1 addition & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ packages/react-refresh-utils/**/*.js
packages/react-dev-overlay/lib/**
**/__tmp__/**
.github/actions/next-stats-action/.work
.github/actions/issue-validator/index.mjs
.github/actions/issue-labeler/lib/index.js
.github/actions/validate-docs-links/lib/index.js
.github/actions/needs-triage/index.js
.github/actions/minus-one/index.mjs
.github/actions/*/index.mjs
packages/next-codemod/transforms/__testfixtures__/**/*
packages/next-codemod/transforms/__tests__/**/*
packages/next-codemod/**/*.js
Expand Down
90 changes: 52 additions & 38 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,36 +43,51 @@
},
{ "files": ["**/__tests__/**"], "env": { "jest": true } },
{
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/stylistic"
],
"files": ["**/*.ts", "**/*.tsx"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
},
"warnOnUnsupportedTypeScriptVersion": false
},
"plugins": ["@typescript-eslint"],
"rules": {
// Already handled by TS
"no-dupe-class-members": "off",
"no-undef": "off",

// Add TypeScript specific rules (and turn off ESLint equivalents)
"@typescript-eslint/consistent-type-assertions": "warn",
"no-array-constructor": "off",
"@typescript-eslint/no-array-constructor": "warn",
// Todo: investigate, for each of these rules, whether we want them.
"@typescript-eslint/array-type": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/ban-tslint-comment": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/class-literal-property-style": "off",
"@typescript-eslint/consistent-generic-constructors": "off",
"@typescript-eslint/consistent-indexed-object-style": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-namespace": "off",
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": [
"warn",
"@typescript-eslint/no-shadow": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/prefer-for-of": "off",
"@typescript-eslint/prefer-function-type": "off",
"@typescript-eslint/no-this-alias": "off",
"@typescript-eslint/triple-slash-reference": "off",
"no-var": "off",
"prefer-const": "off",
"prefer-rest-params": "off",
"prefer-spread": "off",

// These off- or differently-configured rules work well for us.
"no-unused-expressions": "off",
"@typescript-eslint/no-unused-expressions": [
"error",
{
"functions": true,
"classes": true,
"variables": true,
"enums": true,
"typedefs": true
"allowShortCircuit": true,
"allowTernary": true,
"allowTaggedTemplates": true
}
],
"no-unused-vars": "off",
Expand All @@ -83,29 +98,28 @@
"ignoreRestSiblings": true
}
],
"no-unused-expressions": "off",
"@typescript-eslint/no-unused-expressions": [
"error",
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": [
"warn",
{
"allowShortCircuit": true,
"allowTernary": true,
"allowTaggedTemplates": true
"functions": true,
"classes": true,
"variables": true,
"enums": true,
"typedefs": true
}
],
"no-useless-constructor": "off",
"@typescript-eslint/no-useless-constructor": "warn",
"@typescript-eslint/prefer-literal-enum-member": "error",
"@typescript-eslint/prefer-namespace-keyword": "error"
},
"overrides": [
{
"files": ["packages/**"],
"rules": {
"jsdoc/no-types": "error",
"jsdoc/no-undefined-types": "error"
}
}
]
"@typescript-eslint/prefer-literal-enum-member": "error"
}
},
{
"files": ["packages/**/*.tsx?"],
"rules": {
"jsdoc/no-types": "error",
"jsdoc/no-undefined-types": "error"
}
},
{
"files": [
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/1.bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ body:
description: |
A link to a [GitHub repository](https://github.com/vercel/next.js/tree/canary/examples/reproduction-template) or a [CodeSandbox](https://codesandbox.io/p/sandbox/github/vercel/next.js/tree/canary/examples/reproduction-template) minimal reproduction. Minimal reproductions should be created from our [bug report template with `npx create-next-app -e reproduction-template`](https://github.com/vercel/next.js/tree/canary/examples/reproduction-template) and should include only changes that contribute to the issue.
If a minimal reproduction can't be created please share a [replay](https://www.replay.io/) of the bug which doesn't require sharing a private repo.
To report an App Router related issue, you can use these templates: [CodeSandbox](https://codesandbox.io/p/sandbox/github/vercel/next.js/tree/canary/examples/reproduction-template-app-dir) or [`npx create-next-app -e reproduction-template-app-dir`](https://github.com/vercel/next.js/tree/canary/examples/reproduction-template-app-dir)
To report a Pages Router related issue, you can use these templates: [CodeSandbox](https://codesandbox.io/p/sandbox/github/vercel/next.js/tree/canary/examples/reproduction-template-pages) or [`npx create-next-app -e reproduction-template-pages`](https://github.com/vercel/next.js/tree/canary/examples/reproduction-template-pages)
validations:
required: true
- type: textarea
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/issue-validator/canary.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ If the issue does not reproduce with the `canary` version, then it has already b

### **How can I quickly verify if my issue has been fixed in `canary`?**

The safest way is to install `next@canary` in your project and test it, but you can also search through [closed Next.js issues](https://github.com/vercel/next.js/issues?q=is%3Aissue+is%3Aclosed) for duplicates or check the [Next.js releases](https://github.com/vercel/next.js/releases). You can also use the GitHub templates (preferred) for [pages](https://github.com/vercel/next.js/tree/canary/examples/reproduction-template) and [App Router](https://github.com/vercel/next.js/tree/canary/examples/reproduction-template-app-dir), or the [CodeSandbox: `pages`](https://codesandbox.io/s/github/vercel/next.js/tree/canary/examples/reproduction-template) or [CodeSandbox: App Router](https://github.com/vercel/next.js/tree/canary/examples/reproduction-template-app-dir) templates to create a reproduction with `canary` from scratch.
The safest way is to install `next@canary` in your project and test it, but you can also search through [closed Next.js issues](https://github.com/vercel/next.js/issues?q=is%3Aissue+is%3Aclosed) for duplicates or check the [Next.js releases](https://github.com/vercel/next.js/releases). You can also use the GitHub templates (preferred) for [App Router](https://github.com/vercel/next.js/tree/canary/examples/reproduction-template) and [Pages Router](https://github.com/vercel/next.js/tree/canary/examples/reproduction-template-pages), or the [CodeSandbox: App Router](https://codesandbox.io/s/github/vercel/next.js/tree/canary/examples/reproduction-template) or [CodeSandbox: Pages Router](https://codesandbox.io/s/github/vercel/next.js/tree/canary/examples/reproduction-template-pages) templates to create a reproduction with `canary` from scratch.

### **My issue has been open for a long time, why do I need to verify `canary` now?**

Expand Down
2 changes: 1 addition & 1 deletion .github/actions/issue-validator/repro.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ We cannot recreate the issue with the provided information. **Please add a repro

### **Why was this issue marked with the `please add a complete reproduction` label?**

To be able to investigate, we need access to a reproduction to identify what triggered the issue. We prefer a link to a public GitHub repository ([template for `pages`](https://github.com/vercel/next.js/tree/canary/examples/reproduction-template), [template for App Router](https://github.com/vercel/next.js/tree/canary/examples/reproduction-template-app-dir)), but you can also use these templates: [CodeSandbox: `pages`](https://codesandbox.io/s/github/vercel/next.js/tree/canary/examples/reproduction-template) or [CodeSandbox: App Router](https://github.com/vercel/next.js/tree/canary/examples/reproduction-template-app-dir).
To be able to investigate, we need access to a reproduction to identify what triggered the issue. We prefer a link to a public GitHub repository ([template for App Router](https://github.com/vercel/next.js/tree/canary/examples/reproduction-template), [template for Pages Router](https://github.com/vercel/next.js/tree/canary/examples/reproduction-template-pages)), but you can also use these templates: [CodeSandbox: App Router](https://codesandbox.io/s/github/vercel/next.js/tree/canary/examples/reproduction-template) or [CodeSandbox: Pages Router](https://codesandbox.io/s/github/vercel/next.js/tree/canary/examples/reproduction-template-pages).

To make sure the issue is resolved as quickly as possible, please make sure that the reproduction is as **minimal** as possible. This means that you should **remove unnecessary code, files, and dependencies** that do not contribute to the issue. Ensure your reproduction does not depend on secrets, 3rd party registries, private dependencies, or any other data that cannot be made public. Avoid a reproduction including a whole monorepo (unless relevant to the issue). The easier it is to reproduce the issue, the quicker we can help.

Expand Down
3 changes: 1 addition & 2 deletions .github/actions/minus-one/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"build": "ncc -m -o . build src/index.mjs --license licenses.txt"
},
"devDependencies": {
"@vercel/ncc": "0.34.0",
"typescript": "5.1.6"
"@vercel/ncc": "0.34.0"
},
"dependencies": {
"@actions/core": "1.10.0",
Expand Down
19 changes: 10 additions & 9 deletions .github/actions/next-stats-action/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,25 @@ LABEL com.github.actions.name="Next.js PR Stats"
LABEL com.github.actions.description="Compares stats of a PR with the main branch"
LABEL repository="https://github.com/vercel/next-stats-action"

COPY . /next-stats

RUN apt update && apt upgrade -y
RUN apt install unzip wget curl nano htop screen build-essential pkg-config libssl-dev git build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libreadline-dev libffi-dev python3 moreutils jq iproute2 openssh-server sudo whois dnsutils -y
RUN apt install unzip wget curl nano htop screen build-essential pkg-config libssl-dev git build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libreadline-dev libffi-dev python3 moreutils jq iproute2 openssh-server sudo whois dnsutils apache2-utils -y

RUN ln $(which python3) /usr/bin/python

RUN curl -sfLS https://install-node.vercel.app/v18.16.1 | bash -s -- -f
RUN corepack enable

WORKDIR /next-stats

# Install node_modules
RUN npm i -g [email protected] [email protected]
RUN cd /next-stats && pnpm install --production
COPY package.json ./
RUN pnpm install --production

RUN git config --global user.email 'stats@localhost'
RUN git config --global user.name 'next stats'
# caching optimization
COPY . .

RUN apt update
RUN apt install apache2-utils -y
RUN git config --global user.email 'stats@localhost' && \
git config --global user.name 'next stats'

COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
7 changes: 6 additions & 1 deletion .github/actions/next-stats-action/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,10 @@
},
"devDependencies": {
"typescript": "5.1.6"
}
},
"engines": {
"node": ">=16.8.0",
"pnpm": "8.6.11"
},
"packageManager": "[email protected]"
}
21 changes: 21 additions & 0 deletions .github/actions/pr-approved-open/index.mjs

Large diffs are not rendered by default.

Loading

0 comments on commit c0d5fae

Please sign in to comment.