Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nextjs): bump Next.js version to 12.0.7 #7788

Merged
merged 1 commit into from
Dec 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"ejs": "^3.1.5",
"enhanced-resolve": "^5.8.3",
"eslint": "8.2.0",
"eslint-config-next": "12.0.0",
"eslint-config-next": "12.0.7",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yarn upgrade eslint-config-next@12.0.7

"eslint-config-prettier": "^8.1.0",
"eslint-plugin-cypress": "^2.10.3",
"eslint-plugin-import": "2.25.2",
Expand Down Expand Up @@ -188,7 +188,7 @@
"mime": "2.4.4",
"mini-css-extract-plugin": "^2.1.0",
"minimatch": "3.0.4",
"next": "12.0.0",
"next": "12.0.7",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yarn upgrade next@12.0.7

"next-sitemap": "^1.6.108",
"ng-packagr": "~13.0.0",
"ngrx-store-freeze": "0.2.4",
Expand Down
13 changes: 13 additions & 0 deletions packages/next/migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,19 @@
"alwaysAddToPackageJson": false
}
}
},
"13.3.0": {
"version": "13.3.0-beta.0",
Copy link
Contributor Author

@puku0x puku0x Nov 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because Nx v13.3.0 supports the latest version of angular-eslint and I expect
it will be shipped soon. 512f094

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next.js v12.0.5+ supports ESLint v8, which means this migration is suitable for Nx v13.3.0

"packages": {
"next": {
"version": "12.0.7",
"alwaysAddToPackageJson": false
},
"eslint-config-next": {
"version": "12.0.7",
"alwaysAddToPackageJson": false
}
}
}
}
}
2 changes: 1 addition & 1 deletion packages/next/plugins/with-less.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function withLess({ lessLoaderOptions = {}, ...nextConfig }) {
let sassGlobalRule;

const cssRule = config.module.rules.find((rule) =>
rule.oneOf?.find((r) => r?.options?.__next_css_remove)
rule.oneOf?.find((r) => r?.[Symbol.for('__next_css_remove')])
);

const addLessToRuleTest = (test) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/next/plugins/with-stylus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function withStylus({ stylusLoaderOptions = {}, ...nextConfig }: any) {
let sassGlobalRule;

const cssRule = config.module.rules.find((rule) =>
rule.oneOf?.find((r) => r?.options?.__next_css_remove)
rule.oneOf?.find((r) => r?.[Symbol.for('__next_css_remove')])
);

const addStylusRuleToTest = (test) => {
Expand Down
5 changes: 3 additions & 2 deletions packages/next/src/executors/build/build.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ export default async function buildExecutor(
options: NextBuildBuilderOptions,
context: ExecutorContext
) {
let dependencies: DependentBuildableProjectNode[] = [];
process.env.NODE_ENV ||= 'production';
// Cast to any to overwrite NODE_ENV
(process.env as any).NODE_ENV ||= 'production';
kirjai marked this conversation as resolved.
Show resolved Hide resolved

let dependencies: DependentBuildableProjectNode[] = [];
const root = resolve(context.root, options.root);
const libsDir = join(context.root, workspaceLayout().libsDir);

Expand Down
4 changes: 3 additions & 1 deletion packages/next/src/executors/server/server.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ export default async function* serveExecutor(
options: NextServeBuilderOptions,
context: ExecutorContext
) {
process.env.NODE_ENV = process.env.NODE_ENV
// Cast to any to overwrite NODE_ENV
(process.env as any).NODE_ENV = process.env.NODE_ENV
? process.env.NODE_ENV
: options.dev
? 'development'
: 'production';

let dependencies: DependentBuildableProjectNode[] = [];
const buildTarget = parseTargetString(options.buildTarget);
const baseUrl = `http://${options.hostname || 'localhost'}:${options.port}`;
Expand Down
4 changes: 2 additions & 2 deletions packages/next/src/utils/versions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const nxVersion = '*';

export const nextVersion = '12.0.0';
export const eslintConfigNextVersion = '12.0.0';
export const nextVersion = '12.0.7';
export const eslintConfigNextVersion = '12.0.7';
export const sassVersion = '1.43.2';
export const lessLoader = '10.2.0';
export const stylusLoader = '6.2.0';
Expand Down
299 changes: 171 additions & 128 deletions yarn.lock

Large diffs are not rendered by default.