@stackframe/init-stack 2.6.19 → 2.6.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/index.mjs +7 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/index.mjs
CHANGED
|
@@ -75,18 +75,19 @@ async function main() {
|
|
|
75
75
|
);
|
|
76
76
|
}
|
|
77
77
|
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));
|
|
78
|
-
|
|
78
|
+
const nextVersionInPackageJson = packageJson?.dependencies["next"] ?? packageJson?.devDependencies["next"];
|
|
79
|
+
if (!nextVersionInPackageJson) {
|
|
79
80
|
throw new UserError(
|
|
80
81
|
`The project at ${projectPath} does not appear to be a Next.js project, or does not have 'next' installed as a dependency. Only Next.js projects are currently supported.`
|
|
81
82
|
);
|
|
82
83
|
}
|
|
83
|
-
const nextPackageJsonVersion = packageJson.dependencies["next"];
|
|
84
84
|
if (
|
|
85
|
-
!
|
|
86
|
-
|
|
85
|
+
!nextVersionInPackageJson.includes("14") &&
|
|
86
|
+
!nextVersionInPackageJson.includes("15") &&
|
|
87
|
+
nextVersionInPackageJson !== "latest"
|
|
87
88
|
) {
|
|
88
89
|
throw new UserError(
|
|
89
|
-
`The project at ${projectPath} is using an unsupported version of Next.js (found ${
|
|
90
|
+
`The project at ${projectPath} is using an unsupported version of Next.js (found ${nextVersionInPackageJson}).\n\nOnly Next.js 14 & 15 projects are currently supported. See Next's upgrade guide: https://nextjs.org/docs/app/building-your-application/upgrading/version-14`
|
|
90
91
|
);
|
|
91
92
|
}
|
|
92
93
|
|
|
@@ -230,7 +231,7 @@ async function main() {
|
|
|
230
231
|
handlerPath,
|
|
231
232
|
`import { StackHandler } from "@stackframe/stack";\nimport { stackServerApp } from "../../../stack";\n\nexport default function Handler(props${
|
|
232
233
|
handlerFileExtension.includes("ts") ? ": any" : ""
|
|
233
|
-
}) {\n${ind}return <StackHandler fullPage app={stackServerApp} {
|
|
234
|
+
}) {\n${ind}return <StackHandler fullPage app={stackServerApp} routeProps={props} />;\n}\n`
|
|
234
235
|
);
|
|
235
236
|
await writeFileIfNotExists(
|
|
236
237
|
stackAppPath,
|