fixed typo

This commit is contained in:
Zai Shi 2024-08-31 18:11:13 -07:00
parent 9d0cb86677
commit 6f830e7275

View File

@ -63,7 +63,6 @@ async function main() {
`);
console.log();
let projectPath = await getProjectPath();
if (!fs.existsSync(projectPath)) {
throw new UserError(`The project path ${projectPath} does not exist`);
@ -82,7 +81,10 @@ async function main() {
);
}
const nextPackageJsonVersion = packageJson.dependencies["next"];
if (!nextPackageJsonVersion.includes("14") && nextPackageJsonVersion !== "latest") {
if (
!nextPackageJsonVersion.includes("14") &&
nextPackageJsonVersion !== "latest"
) {
throw new UserError(
`The project at ${projectPath} is using an unsupported version of Next.js (found ${packageJson.dependencies["next"]}).\n\nOnly Next.js 14 projects are currently supported. See Next's upgrade guide: https://nextjs.org/docs/app/building-your-application/upgrading/version-14`
);
@ -226,7 +228,9 @@ async function main() {
);
await writeFileIfNotExists(
handlerPath,
`import { StackHandler } from "@stackframe/stack";\nimport { stackServerApp } from "../../../stack";\n\nexport default function Handler(props${handlerFileExtension.includes("ts") ? ": any" : ""}) {\n${ind}return <StackHandler fullPage app={stackServerApp} {...props} />;\n}\n`
`import { StackHandler } from "@stackframe/stack";\nimport { stackServerApp } from "../../../stack";\n\nexport default function Handler(props${
handlerFileExtension.includes("ts") ? ": any" : ""
}) {\n${ind}return <StackHandler fullPage app={stackServerApp} {...props} />;\n}\n`
);
await writeFileIfNotExists(
stackAppPath,
@ -238,7 +242,9 @@ async function main() {
console.log();
console.log();
console.log();
console.log(`${ansis.bold}${ansis.green}Installation succeeded!${ansis.clear}`);
console.log(
`${ansis.bold}${ansis.green}Installation succeeded!${ansis.clear}`
);
console.log();
console.log("Commands executed:");
for (const command of commandsExecuted) {
@ -259,19 +265,29 @@ main()
console.log();
console.log();
console.log();
console.log(`${ansis.green}===============================================${ansis.clear}`);
console.log(
`${ansis.green}===============================================${ansis.clear}`
);
console.log();
console.log(`${ansis.green}Successfully installed Stack! 🚀🚀🚀${ansis.clear}`);
console.log(
`${ansis.green}Successfully installed Stack! 🚀🚀🚀${ansis.clear}`
);
console.log();
console.log("Next steps:");
console.log(" 1. Create an account and project on https://app.stack-auth.com");
console.log(" 2. Copy the environment variables from the new API key into your .env.local file");
console.log(
" 1. Create an account and project on https://app.stack-auth.com"
);
console.log(
" 2. Copy the environment variables from the new API key into your .env.local file"
);
console.log();
console.log(
"Then, you will be able to access your sign-in page on http://your-website.example.com/handler/sign-in. That's it!"
);
console.log();
console.log(`${ansis.green}===============================================${ansis.clear}`);
console.log(
`${ansis.green}===============================================${ansis.clear}`
);
console.log();
console.log(
"For more information, please visit https://docs.stack-auth.com/docs/getting-started/setup"
@ -287,20 +303,22 @@ main()
console.error();
console.error();
console.error();
console.error(`${ansis.red}===============================================${ansis.clear}`);
console.error(
`${ansis.red}===============================================${ansis.clear}`
);
console.error();
if (err instanceof UserError) {
console.error(`${ansis.red}ERROR!${ansis.clear} ${err.message}`);
} else {
console.error(
"An error occurred during the initialization process."
);
console.error("An error occurred during the initialization process.");
}
console.error();
console.error(`${ansis.red}===============================================${ansis.clear}`);
console.error(
`${ansis.red}===============================================${ansis.clear}`
);
console.error();
console.error(
"If you need assistance, please try installing Slack manually as described in https://docs.stack-auth.com/docs/getting-started/setup or join our Discord where we're happy to help: https://discord.stack-auth.com"
"If you need assistance, please try installing Stack manually as described in https://docs.stack-auth.com/docs/getting-started/setup or join our Discord where we're happy to help: https://discord.stack-auth.com"
);
if (!(err instanceof UserError)) {
console.error("");
@ -455,16 +473,19 @@ async function getPackageManager() {
return answers.packageManager;
}
async function shellNicelyFormatted(command, { quiet, ...options }) {
console.log();
const ui = new inquirer.ui.BottomBar();
let dots = 4;
ui.updateBottomBar(`${ansis.blue}Running command: ${command}...${ansis.clear}`);
ui.updateBottomBar(
`${ansis.blue}Running command: ${command}...${ansis.clear}`
);
const interval = setInterval(() => {
if (!isDryRun) {
ui.updateBottomBar(
`${ansis.blue}Running command: ${command}${".".repeat(dots++ % 5)}${ansis.clear}`
`${ansis.blue}Running command: ${command}${".".repeat(dots++ % 5)}${
ansis.clear
}`
);
}
}, 700);
@ -494,7 +515,11 @@ async function shellNicelyFormatted(command, { quiet, ...options }) {
}
} finally {
clearTimeout(interval);
ui.updateBottomBar(quiet ? "" : `${ansis.green}${ansis.clear} Command ${command} succeeded\n`);
ui.updateBottomBar(
quiet
? ""
: `${ansis.green}${ansis.clear} Command ${command} succeeded\n`
);
ui.close();
}
}