Skip to content

Commit

Permalink
feat(Next): Support Next.js 14
Browse files Browse the repository at this point in the history
  • Loading branch information
xrutayisire committed Oct 30, 2023
1 parent 9486332 commit f7399c7
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion cypress-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ else
fi

rm -rf e2e-projects/cypress-next-app \
&& yarn dlx --quiet create-next-app@13.5.4 --app --eslint --import-alias '@/*' --no-src-dir --tailwind --typescript --use-npm e2e-projects/cypress-next-app \
&& yarn dlx --quiet create-next-app@latest --app --eslint --import-alias '@/*' --no-src-dir --tailwind --typescript --use-npm e2e-projects/cypress-next-app \
&& yarn dlx --quiet vite-node ./cypress/plugins/addAuth.ts -- ${EMAIL} ${PASSWORD} ${PRISMIC_URL} \
&& yarn dlx --quiet vite-node ./cypress/plugins/createRepo.ts -- "${_PRISMIC_REPO}" "${PASSWORD}" "${PRISMIC_URL}" \
&& yarn workspaces foreach --include '{@slicemachine/adapter-next,@slicemachine/init,@slicemachine/manager,@slicemachine/plugin-kit,slice-machine-ui,start-slicemachine}' --topological --verbose pack --out "${THIS_DIR}"/e2e-projects/cypress-next-app/%s-%v.tgz \
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"vitest": "0.32.0"
},
"peerDependencies": {
"next": "^11 || ^12 || ^13",
"next": ">=11.0.0",
"react": "^17 || ^18"
},
"engines": {
Expand Down
12 changes: 6 additions & 6 deletions packages/init/src/lib/framework.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export type Framework = {
* Framework 's id sent to Segment from Slice Machine
*/
sliceMachineTelemetryID:
| "next-11-13"
| "next"
| "nuxt-2"
| "nuxt-3"
| "sveltekit-1"
Expand Down Expand Up @@ -97,14 +97,14 @@ export const FRAMEWORKS: Record<string, Framework> = {
"@slicemachine/adapter-nuxt": isPrerelease ? "alpha" : "latest",
},
},
"next-11-13": {
name: "Next.js 11-13",
sliceMachineTelemetryID: "next-11-13",
next: {
name: "Next.js",
sliceMachineTelemetryID: "next",
wroomTelemetryID: "next",
prismicDocumentation: "https://prismic.dev/init/next-11-13",
prismicDocumentation: "https://prismic.dev/init/next",
adapterName: "@slicemachine/adapter-next",
compatibility: {
next: "^11.0.0 || ^12.0.0 || ^13.0.0",
next: ">=11.0.0",
},
devDependencies: {
...DEFAULT_DEV_DEPENDENCIES,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ it("detects framework, starter and package manager", async () => {
"framework": {
"adapterName": "@slicemachine/adapter-next",
"compatibility": {
"next": "^11.0.0 || ^12.0.0 || ^13.0.0",
"next": ">=11.0.0",
},
"devDependencies": {
"@slicemachine/adapter-next": "latest",
"slice-machine-ui": "latest",
},
"name": "Next.js 11-13",
"prismicDocumentation": "https://prismic.dev/init/next-11-13",
"sliceMachineTelemetryID": "next-11-13",
"name": "Next.js",
"prismicDocumentation": "https://prismic.dev/init/next",
"sliceMachineTelemetryID": "next",
"wroomTelemetryID": "next",
},
"packageManager": "npm",
Expand Down Expand Up @@ -82,15 +82,15 @@ it("assumes unconventional tags match semver range when detecting framework", as
"framework": {
"adapterName": "@slicemachine/adapter-next",
"compatibility": {
"next": "^11.0.0 || ^12.0.0 || ^13.0.0",
"next": ">=11.0.0",
},
"devDependencies": {
"@slicemachine/adapter-next": "latest",
"slice-machine-ui": "latest",
},
"name": "Next.js 11-13",
"prismicDocumentation": "https://prismic.dev/init/next-11-13",
"sliceMachineTelemetryID": "next-11-13",
"name": "Next.js",
"prismicDocumentation": "https://prismic.dev/init/next",
"sliceMachineTelemetryID": "next",
"wroomTelemetryID": "next",
},
"packageManager": "npm",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,22 @@ export const FRAMEWORKS: Record<string, Framework> = {
},
},
previousNext: {
name: "Next.js 11-13 (legacy)",
name: "Next.js (legacy)",
adapterName: "@slicemachine/adapter-next",
adapterVersion: "latest",
runProjectInitHook: true,
compatibility: {
next: "^11.0.0 || ^12.0.0 || ^13.0.0",
next: ">=11.0.0",
"prismic-reactjs": "*",
},
},
next: {
name: "Next.js 11-13",
name: "Next.js",
adapterName: "@slicemachine/adapter-next",
adapterVersion: "latest",
runProjectInitHook: false,
compatibility: {
next: "^11.0.0 || ^12.0.0 || ^13.0.0",
next: ">=11.0.0",
},
},
} as const;
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8196,7 +8196,7 @@ __metadata:
vite-plugin-sdk: 0.1.1
vitest: 0.32.0
peerDependencies:
next: ^11 || ^12 || ^13
next: ">=11.0.0"
react: ^17 || ^18
languageName: unknown
linkType: soft
Expand Down

0 comments on commit f7399c7

Please sign in to comment.