-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nextjs): update createNodes to createNodesV2 and add deprecation…
… message (#28527) <!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> Currently, we are using `createNodes` API which should be deprecated in favour of `createNodesV2`. ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> We should be using `createNodesV2` instead of `createNodes`. ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #
- Loading branch information
1 parent
8b5ee36
commit 19e765f
Showing
6 changed files
with
227 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
export { createNodes, NextPluginOptions } from './src/plugins/plugin'; | ||
export { | ||
createNodes, | ||
createNodesV2, | ||
NextPluginOptions, | ||
} from './src/plugins/plugin'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
214 changes: 112 additions & 102 deletions
214
packages/next/src/plugins/__snapshots__/plugin.spec.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,121 +1,131 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`@nx/next/plugin integrated projects should create nodes 1`] = ` | ||
{ | ||
"projects": { | ||
"my-app": { | ||
"root": "my-app", | ||
"targets": { | ||
"my-build": { | ||
"cache": true, | ||
"command": "next build", | ||
"dependsOn": [ | ||
"^build", | ||
], | ||
"inputs": [ | ||
"default", | ||
"^production", | ||
{ | ||
"externalDependencies": [ | ||
"next", | ||
[ | ||
[ | ||
"my-app/next.config.js", | ||
{ | ||
"projects": { | ||
"my-app": { | ||
"root": "my-app", | ||
"targets": { | ||
"my-build": { | ||
"cache": true, | ||
"command": "next build", | ||
"dependsOn": [ | ||
"^build", | ||
], | ||
"inputs": [ | ||
"default", | ||
"^production", | ||
{ | ||
"externalDependencies": [ | ||
"next", | ||
], | ||
}, | ||
], | ||
"options": { | ||
"cwd": "my-app", | ||
"tty": false, | ||
}, | ||
"outputs": [ | ||
"{workspaceRoot}/my-app/.next", | ||
"{workspaceRoot}/my-app/.next/!(cache)", | ||
], | ||
}, | ||
], | ||
"options": { | ||
"cwd": "my-app", | ||
"tty": false, | ||
}, | ||
"outputs": [ | ||
"{workspaceRoot}/my-app/.next", | ||
"{workspaceRoot}/my-app/.next/!(cache)", | ||
], | ||
}, | ||
"my-serve": { | ||
"command": "next dev", | ||
"options": { | ||
"cwd": "my-app", | ||
}, | ||
}, | ||
"my-serve-static": { | ||
"executor": "@nx/web:file-server", | ||
"options": { | ||
"buildTarget": "my-build", | ||
"port": 3000, | ||
"spa": false, | ||
"staticFilePath": "{projectRoot}/out", | ||
}, | ||
}, | ||
"my-start": { | ||
"command": "next start", | ||
"dependsOn": [ | ||
"my-build", | ||
], | ||
"options": { | ||
"cwd": "my-app", | ||
"my-serve": { | ||
"command": "next dev", | ||
"options": { | ||
"cwd": "my-app", | ||
}, | ||
}, | ||
"my-serve-static": { | ||
"executor": "@nx/web:file-server", | ||
"options": { | ||
"buildTarget": "my-build", | ||
"port": 3000, | ||
"spa": false, | ||
"staticFilePath": "{projectRoot}/out", | ||
}, | ||
}, | ||
"my-start": { | ||
"command": "next start", | ||
"dependsOn": [ | ||
"my-build", | ||
], | ||
"options": { | ||
"cwd": "my-app", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
} | ||
], | ||
] | ||
`; | ||
|
||
exports[`@nx/next/plugin root projects should create nodes 1`] = ` | ||
{ | ||
"projects": { | ||
".": { | ||
"root": ".", | ||
"targets": { | ||
"build": { | ||
"cache": true, | ||
"command": "next build", | ||
"dependsOn": [ | ||
"^build", | ||
], | ||
"inputs": [ | ||
"default", | ||
"^production", | ||
{ | ||
"externalDependencies": [ | ||
"next", | ||
[ | ||
[ | ||
"next.config.js", | ||
{ | ||
"projects": { | ||
".": { | ||
"root": ".", | ||
"targets": { | ||
"build": { | ||
"cache": true, | ||
"command": "next build", | ||
"dependsOn": [ | ||
"^build", | ||
], | ||
"inputs": [ | ||
"default", | ||
"^production", | ||
{ | ||
"externalDependencies": [ | ||
"next", | ||
], | ||
}, | ||
], | ||
"options": { | ||
"cwd": ".", | ||
"tty": false, | ||
}, | ||
"outputs": [ | ||
"{projectRoot}/.next", | ||
"{projectRoot}/.next/!(cache)", | ||
], | ||
}, | ||
], | ||
"options": { | ||
"cwd": ".", | ||
"tty": false, | ||
}, | ||
"outputs": [ | ||
"{projectRoot}/.next", | ||
"{projectRoot}/.next/!(cache)", | ||
], | ||
}, | ||
"dev": { | ||
"command": "next dev", | ||
"options": { | ||
"cwd": ".", | ||
}, | ||
}, | ||
"serve-static": { | ||
"executor": "@nx/web:file-server", | ||
"options": { | ||
"buildTarget": "build", | ||
"port": 3000, | ||
"spa": false, | ||
"staticFilePath": "{projectRoot}/out", | ||
}, | ||
}, | ||
"start": { | ||
"command": "next start", | ||
"dependsOn": [ | ||
"build", | ||
], | ||
"options": { | ||
"cwd": ".", | ||
"dev": { | ||
"command": "next dev", | ||
"options": { | ||
"cwd": ".", | ||
}, | ||
}, | ||
"serve-static": { | ||
"executor": "@nx/web:file-server", | ||
"options": { | ||
"buildTarget": "build", | ||
"port": 3000, | ||
"spa": false, | ||
"staticFilePath": "{projectRoot}/out", | ||
}, | ||
}, | ||
"start": { | ||
"command": "next start", | ||
"dependsOn": [ | ||
"build", | ||
], | ||
"options": { | ||
"cwd": ".", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
} | ||
], | ||
] | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.