Skip to content

Commit

Permalink
improve octokit & vercel instance usage
Browse files Browse the repository at this point in the history
  • Loading branch information
blefnk committed Feb 7, 2025
1 parent eb02018 commit 7250661
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 64 deletions.
2 changes: 1 addition & 1 deletion build.publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ async function removeDistFolders(): Promise<boolean> {
}
}
if (existingFolders.length > 0) {
logger.info(
logger.verbose(
`Found existing distribution folders: ${existingFolders.join(", ")}`,
true,
);
Expand Down
72 changes: 36 additions & 36 deletions bun.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cspell.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.4.68",
"version": "1.4.70",
"language": "en",
"ignorePaths": [
"**/*.lock",
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@reliverse/cli",
"author": "reliverse",
"version": "1.4.68",
"version": "1.4.70",
"type": "module",
"license": "MIT",
"keywords": ["cli"],
Expand Down Expand Up @@ -47,7 +47,7 @@
"@types/mute-stream": "^0.0.4",
"@vercel/sdk": "^1.3.1",
"@vitejs/plugin-react": "^4.3.4",
"ai": "^4.1.24",
"ai": "^4.1.25",
"async-listen": "^3.0.1",
"better-sqlite3": "^11.8.1",
"bun-types": "^1.2.2",
Expand Down Expand Up @@ -79,7 +79,7 @@
"nanoid": "^5.0.9",
"nanotar": "^0.2.0",
"nypm": "^0.5.2",
"octokit": "^4.1.0",
"octokit": "^4.1.1",
"ofetch": "^1.4.1",
"open": "^10.1.0",
"ora": "^8.2.0",
Expand All @@ -91,7 +91,7 @@
"random-words": "^2.0.1",
"react-router": "^7.1.5",
"react-router-dom": "^7.1.5",
"rollup": "^4.34.4",
"rollup": "^4.34.5",
"rollup-plugin-dts": "^6.1.1",
"scule": "^1.3.0",
"semver": "^7.7.1",
Expand Down Expand Up @@ -121,10 +121,10 @@
"@t3-oss/env-nextjs": "^0.12.0",
"@tanstack/react-query": "^5.66.0",
"@total-typescript/ts-reset": "^0.6.1",
"@trpc/client": "^11.0.0-rc.741",
"@trpc/next": "^11.0.0-rc.741",
"@trpc/react-query": "^11.0.0-rc.741",
"@trpc/server": "^11.0.0-rc.741",
"@trpc/client": "^11.0.0-rc.744",
"@trpc/next": "^11.0.0-rc.744",
"@trpc/react-query": "^11.0.0-rc.744",
"@trpc/server": "^11.0.0-rc.744",
"@types/better-sqlite3": "^7.6.12",
"@types/bun": "^1.2.2",
"@types/cross-spawn": "^6.0.6",
Expand Down
2 changes: 1 addition & 1 deletion src/app/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { re } from "@reliverse/relico";
import path from "pathe";
import { fileURLToPath } from "url";

export const cliVersion = "1.4.68";
export const cliVersion = "1.4.70";
export const cliName = "@reliverse/cli";
export const cliDomain = "https://docs.reliverse.org";

Expand Down
12 changes: 4 additions & 8 deletions src/app/menu/create-project/cp-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,11 @@ export async function setupI18nSupport(
*/
export async function shouldInstallDependencies(
behavior: Behavior,
isDev: boolean,
): Promise<boolean> {
if (behavior === "autoYes") return true;
if (behavior === "autoNo") return false;
if (isDev) return false;

return await confirmPrompt({
title: "Would you like to install dependencies now?",
Expand All @@ -210,7 +212,7 @@ export async function handleDependencies(
config: ReliverseConfig,
) {
const depsBehavior: Behavior = config?.depsBehavior ?? "prompt";
const shouldInstallDeps = await shouldInstallDependencies(depsBehavior);
const shouldInstallDeps = await shouldInstallDependencies(depsBehavior, true);

let shouldRunDbPush = false;
if (shouldInstallDeps) {
Expand Down Expand Up @@ -347,7 +349,6 @@ export async function showSuccessAndNextSteps(
await handleNextActions(
effectiveProjectPath,
vscodeInstalled,
frontendUsername,
isDeployed,
primaryDomain,
allDomains,
Expand All @@ -356,7 +357,7 @@ export async function showSuccessAndNextSteps(

relinka(
"success",
"✨ One more thing you can try (experimental):",
"✨ One more thing you can try (highly experimental):",
"👉 `reliverse cli` in your new project to add/remove features.",
);

Expand All @@ -374,7 +375,6 @@ export async function showSuccessAndNextSteps(
export async function handleNextActions(
projectPath: string,
vscodeInstalled: boolean,
frontendUsername: string,
isDeployed: boolean,
primaryDomain: string,
allDomains: string[],
Expand Down Expand Up @@ -417,10 +417,6 @@ export async function handleNextActions(
for (const action of nextActions) {
await handleNextAction(action, projectPath, primaryDomain, allDomains);
}
relinka(
"info",
frontendUsername ? `See you soon, ${frontendUsername}!` : "Done for now!",
);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export async function deployProject(
);

if (success) {
relinka("success", "Deployment completed!");
relinka("success-verbose", "Deployment completed!");
return {
primaryDomain,
deployService: deployService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { checkVercelDeployment } from "./vercel/vercel-check.js";
*/
type GithubSetupResult = {
success: boolean;
octokit?: InstanceGithub;
githubInstance?: InstanceGithub;
username?: string;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ export async function prepareVercelProjectCreation(
githubToken,
);

relinka("success", `Deployment URL: https://${deployment.url}`);
relinka("success", "✅ Deployment completed successfully!");
relinka("success", `Deployment preview URL: https://${deployment.url}`);
relinka("success-verbose", "✅ Deployment completed successfully!");

return true;
} catch (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,12 @@ export async function createInitialVercelDeployment(
// Monitor deployment progress.
const inProgressStates = ["BUILDING", "INITIALIZING", "QUEUED"] as const;
const deploymentUrl = slug
? `https://vercel.com/${slug}/${projectName}`
? `https://vercel.com/${slug}/${projectName}/${deployment.id}`
: "https://vercel.com";
relinka(
"info",
`Deployment started. Visit ${deploymentUrl} to monitor progress.`,
"Status messages will appear every 20 seconds.",
`Deployment started. To monitor progress, visit: ${deploymentUrl}`,
"Status messages will appear every 10 seconds.",
);

let lastMessageTime = Date.now();
Expand All @@ -181,7 +181,7 @@ export async function createInitialVercelDeployment(
if (!depRes.ok) throw depRes.error;
status = depRes.value.readyState;
const now = Date.now();
if (now - lastMessageTime >= 20000) {
if (now - lastMessageTime >= 10000) {
await relinkaAsync(
"info",
`Deployment status: ${status}`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "template",
"version": "1.4.68",
"version": "1.4.70",
"type": "module",
"private": true,
"scripts": {
Expand Down

0 comments on commit 7250661

Please sign in to comment.