@reliverse/dler 1.7.124 → 1.7.126

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.
Files changed (52) hide show
  1. package/bin/impl/auth/generators/auth-config.d.ts +2 -2
  2. package/bin/impl/auth/generators/auth-config.js +2 -2
  3. package/bin/impl/auth/impl/init.d.ts +1 -1
  4. package/bin/impl/auth/impl/migrate.js +5 -4
  5. package/bin/impl/build/binary-flow.js +1 -1
  6. package/bin/impl/build/impl.d.ts +1 -1
  7. package/bin/impl/build/impl.js +1 -1
  8. package/bin/impl/build/library-flow.js +1 -1
  9. package/bin/impl/build/regular-flow.js +1 -1
  10. package/bin/impl/config/constants.d.ts +1 -1
  11. package/bin/impl/config/constants.js +1 -1
  12. package/bin/impl/config/def-utils.js +3 -3
  13. package/bin/impl/config/detect.js +1 -1
  14. package/bin/impl/config/prepare.js +1 -1
  15. package/bin/impl/init/mm-deprecated/drizzle/manageDrizzleSchema.js +1 -1
  16. package/bin/impl/init/mm-deprecated/feature-add.js +2 -2
  17. package/bin/impl/init/mm-deprecated/feature-rm.js +5 -5
  18. package/bin/impl/init/use-template/cp-impl.js +1 -1
  19. package/bin/impl/init/use-template/cp-modules/git-deploy-prompts/git.js +1 -3
  20. package/bin/impl/login/login-impl.js +7 -9
  21. package/bin/impl/merge/mod.js +1 -1
  22. package/bin/impl/migrate/codemods/anything-bun.js +1 -1
  23. package/bin/impl/providers/better-t-stack/helpers/database-providers/mongodb-atlas-setup.js +8 -7
  24. package/bin/impl/providers/better-t-stack/helpers/database-providers/neon-setup.js +9 -8
  25. package/bin/impl/providers/better-t-stack/helpers/database-providers/prisma-postgres-setup.js +9 -9
  26. package/bin/impl/providers/better-t-stack/helpers/database-providers/turso-setup.js +21 -21
  27. package/bin/impl/providers/better-t-stack/helpers/project-generation/install-dependencies.js +4 -4
  28. package/bin/impl/providers/better-t-stack/helpers/setup/db-setup.js +3 -3
  29. package/bin/impl/providers/better-t-stack/helpers/setup/starlight-setup.js +4 -4
  30. package/bin/impl/providers/better-t-stack/helpers/setup/tauri-setup.js +4 -4
  31. package/bin/impl/providers/better-t-stack/packed/addons.js +1 -1
  32. package/bin/impl/providers/better-t-stack/packed/api.js +2 -2
  33. package/bin/impl/providers/better-t-stack/packed/auth.js +3 -3
  34. package/bin/impl/providers/better-t-stack/packed/backend.js +1 -1
  35. package/bin/impl/providers/better-t-stack/packed/examples.js +3 -3
  36. package/bin/impl/providers/better-t-stack/packed/frontend.js +6 -6
  37. package/bin/impl/providers/better-t-stack/types.d.ts +8 -8
  38. package/bin/impl/providers/better-t-stack/utils/sponsors.js +4 -4
  39. package/bin/impl/pub/impl.d.ts +1 -1
  40. package/bin/impl/pub/impl.js +1 -1
  41. package/bin/impl/pub/pub-library.js +6 -2
  42. package/bin/impl/pub/pub-regular.js +6 -2
  43. package/bin/impl/rempts/cmd.js +7 -7
  44. package/bin/impl/utils/agg/agg-3.js +1 -1
  45. package/bin/impl/utils/downloading/downloadI18nFiles.js +4 -4
  46. package/bin/impl/utils/downloading/downloadRepo.js +6 -6
  47. package/bin/impl/utils/prompts/askUsernameFrontend.js +1 -2
  48. package/bin/mod.d.ts +0 -2
  49. package/bin/mod.js +0 -25
  50. package/package.json +7 -7
  51. package/bin/impl/utils/spinner.d.ts +0 -245
  52. package/bin/impl/utils/spinner.js +0 -370
@@ -1,4 +1,4 @@
1
- import { type spinner as clackSpinner } from "@reliverse/rempts";
1
+ import type { SimpleSpinner } from "@reliverse/rempts";
2
2
  import type { SupportedDatabases, SupportedPlugin } from "../impl/init";
3
3
  type Format = (code: string) => Promise<string>;
4
4
  interface CommonIndexConfig_Regex<AdditionalFields> {
@@ -21,7 +21,7 @@ export type CommonIndexConfig<AdditionalFields> = CommonIndexConfig_Regex<Additi
21
21
  export declare function generateAuthConfig({ format, current_user_config, spinner, plugins, database, }: {
22
22
  format: Format;
23
23
  current_user_config: string;
24
- spinner: ReturnType<typeof clackSpinner>;
24
+ spinner: SimpleSpinner;
25
25
  plugins: SupportedPlugin[];
26
26
  database: SupportedDatabases | null;
27
27
  }): Promise<{
@@ -430,7 +430,7 @@ loginPage: "/sign-in",
430
430
  total_envs.push(...envs);
431
431
  total_dependencies.push(...dependencies);
432
432
  } catch (error) {
433
- spinner.stop(`Something went wrong while generating/updating your new auth config file.`, 1);
433
+ spinner.fail(`Something went wrong while generating/updating your new auth config file.`);
434
434
  logger.error(error.message);
435
435
  process.exit(1);
436
436
  }
@@ -445,7 +445,7 @@ loginPage: "/sign-in",
445
445
  total_dependencies.push(...dependencies);
446
446
  total_envs.push(...envs);
447
447
  } catch (error) {
448
- spinner.stop(`Something went wrong while generating/updating your new auth config file.`, 1);
448
+ spinner.fail(`Something went wrong while generating/updating your new auth config file.`);
449
449
  logger.error(error.message);
450
450
  process.exit(1);
451
451
  }
@@ -146,8 +146,8 @@ export declare const optionsSchema: z.ZodObject<{
146
146
  cwd: z.ZodString;
147
147
  config: z.ZodOptional<z.ZodString>;
148
148
  database: z.ZodOptional<z.ZodEnum<{
149
- sqlite: "sqlite";
150
149
  mysql: "mysql";
150
+ sqlite: "sqlite";
151
151
  mongodb: "mongodb";
152
152
  postgres: "postgres";
153
153
  mssql: "mssql";
@@ -1,6 +1,6 @@
1
1
  import { re } from "@reliverse/relico";
2
2
  import { pathExists } from "@reliverse/relifso";
3
- import { confirmPrompt, useSpinner } from "@reliverse/rempts";
3
+ import { confirmPrompt, createSpinner } from "@reliverse/rempts";
4
4
  import { logger } from "better-auth";
5
5
  import { getAdapter, getMigrations } from "better-auth/db";
6
6
  import path from "path";
@@ -50,7 +50,7 @@ export async function migrateAction(opts) {
50
50
  logger.error("Migrate command isn't supported for this adapter.");
51
51
  process.exit(1);
52
52
  }
53
- const spinner = useSpinner({ text: "preparing migration..." }).start();
53
+ const spinner = createSpinner({ text: "preparing migration..." }).start();
54
54
  const { toBeAdded, toBeCreated, runMigrations } = await getMigrations(config);
55
55
  if (!toBeAdded.length && !toBeCreated.length) {
56
56
  spinner.stop();
@@ -81,9 +81,10 @@ export async function migrateAction(opts) {
81
81
  logger.info("Migration cancelled.");
82
82
  process.exit(0);
83
83
  }
84
- spinner?.start("migrating...");
84
+ spinner?.start();
85
+ spinner.text = "migrating...";
85
86
  await runMigrations();
86
- spinner.stop();
87
+ spinner.succeed("Migration completed!");
87
88
  logger.info("\u{1F680} migration was completed successfully!");
88
89
  process.exit(0);
89
90
  }
@@ -1,6 +1,7 @@
1
1
  import { join } from "@reliverse/pathkit";
2
2
  import { existsSync, mkdir } from "@reliverse/relifso";
3
3
  import { relinka } from "@reliverse/relinka";
4
+ import { createMultiStepSpinner } from "@reliverse/rempts";
4
5
  import {
5
6
  buildForTarget,
6
7
  cleanOutputDir,
@@ -9,7 +10,6 @@ import {
9
10
  parseTargets,
10
11
  validateInputFile
11
12
  } from "./providers/bun/single-file.js";
12
- import { createMultiStepSpinner } from "../utils/spinner.js";
13
13
  function getTargetPrefix(inputFile) {
14
14
  const filename = inputFile.split("/").pop()?.split("\\").pop() || "";
15
15
  const nameWithoutExt = filename.replace(/\.[^/.]+$/, "");
@@ -3,7 +3,7 @@ import type { PerfTimer } from "../types/mod.js";
3
3
  /**
4
4
  * Main entry point for the rse build process.
5
5
  * Handles building for both main project and libraries.
6
- * @see `src-ts/app/pub/impl.ts` for pub main function implementation.
6
+ * @see `src-ts/impl/pub/impl.ts` for pub main function implementation.
7
7
  */
8
8
  export declare function dlerBuild(timer: PerfTimer, isDev: boolean, config?: ReliverseConfig, debugOnlyCopyNonBuildFiles?: boolean, debugDontCopyNonBuildFiles?: boolean, disableOwnSpinner?: boolean): Promise<{
9
9
  timer: PerfTimer;
@@ -1,12 +1,12 @@
1
1
  import path from "@reliverse/pathkit";
2
2
  import fs from "@reliverse/relifso";
3
3
  import { relinka } from "@reliverse/relinka";
4
+ import { createMultiStepSpinner } from "@reliverse/rempts";
4
5
  import { binary_buildFlow } from "./binary-flow.js";
5
6
  import { library_buildFlow } from "./library-flow.js";
6
7
  import { regular_buildFlow } from "./regular-flow.js";
7
8
  import { PROJECT_ROOT } from "../config/constants.js";
8
9
  import { getConfigDler } from "../config/load.js";
9
- import { createMultiStepSpinner } from "../utils/spinner.js";
10
10
  import { removeDistFolders } from "../utils/utils-clean.js";
11
11
  import { handleDlerError } from "../utils/utils-error-cwd.js";
12
12
  import { dlerPostBuild, wrapper_CopyNonBuildFiles } from "./postbuild.js";
@@ -1,10 +1,10 @@
1
1
  import path from "@reliverse/pathkit";
2
2
  import { relinka } from "@reliverse/relinka";
3
+ import { createSpinnerGroup } from "@reliverse/rempts";
3
4
  import pAll from "p-all";
4
5
  import { library_buildLibrary } from "./build-library.js";
5
6
  import { CONCURRENCY_DEFAULT, PROJECT_ROOT } from "../config/constants.js";
6
7
  import { library_publishLibrary } from "../pub/pub-library.js";
7
- import { createSpinnerGroup } from "../utils/spinner.js";
8
8
  import { resumePerfTimer } from "../utils/utils-perf.js";
9
9
  export async function library_buildFlow(timer, isDev, config) {
10
10
  relinka("verbose", "\u2014 \u2014 \u2014 library_buildFlow \u2014 \u2014 \u2014");
@@ -1,7 +1,7 @@
1
1
  import { relinka } from "@reliverse/relinka";
2
+ import { createSpinnerGroup } from "@reliverse/rempts";
2
3
  import pAll from "p-all";
3
4
  import { CONCURRENCY_DEFAULT } from "../config/constants.js";
4
- import { createSpinnerGroup } from "../utils/spinner.js";
5
5
  import { regular_pubToJsr, regular_pubToNpm } from "../pub/pub-regular.js";
6
6
  import { regular_buildJsrDist, regular_buildNpmDist } from "./build-regular.js";
7
7
  export async function regular_buildFlow(timer, isDev, config) {
@@ -1,5 +1,5 @@
1
1
  export declare const PROJECT_ROOT: string;
2
- export declare const cliVersion = "1.7.120";
2
+ export declare const cliVersion = "1.7.126";
3
3
  export declare const cliName = "@reliverse/rse";
4
4
  export declare const rseName = "@reliverse/rse";
5
5
  export declare const dlerName = "@reliverse/dler";
@@ -1,7 +1,7 @@
1
1
  import os from "node:os";
2
2
  import path from "@reliverse/pathkit";
3
3
  export const PROJECT_ROOT = path.resolve(process.cwd());
4
- const version = "1.7.120";
4
+ const version = "1.7.126";
5
5
  export const cliVersion = version;
6
6
  export const cliName = "@reliverse/rse";
7
7
  export const rseName = "@reliverse/rse";
@@ -83,10 +83,10 @@ export async function generateDefaultRulesForProject(projectPath, isDev) {
83
83
  const hasPrismaFile = await fs.pathExists(path.join(projectPath, "prisma/schema.prisma"));
84
84
  const hasDrizzleFile = await fs.pathExists(path.join(projectPath, "drizzle.config.ts"));
85
85
  const hasNextAuthDir = await fs.pathExists(
86
- path.join(projectPath, "src-ts/app/api/auth/[...nextauth]")
86
+ path.join(projectPath, "src-ts/impl/api/auth/[...nextauth]")
87
87
  );
88
88
  const hasBetterAuthFile = await fs.pathExists(
89
- path.join(projectPath, "src-ts/app/api/auth/[...all]/route.ts")
89
+ path.join(projectPath, "src-ts/impl/api/auth/[...all]/route.ts")
90
90
  );
91
91
  const hasShadcnUi = await fs.pathExists(path.join(projectPath, "components/ui"));
92
92
  const hasClerk = "@clerk/nextjs" in deps;
@@ -116,7 +116,7 @@ export async function generateDefaultRulesForProject(projectPath, isDev) {
116
116
  const hasHono = "hono" in deps;
117
117
  const hasTrpc = "@trpc/server" in deps;
118
118
  const hasGraphql = "graphql" in deps || "apollo-server" in deps;
119
- const hasRest = await fs.pathExists(path.join(projectPath, "src/api")) || await fs.pathExists(path.join(projectPath, "src-ts/app/api"));
119
+ const hasRest = await fs.pathExists(path.join(projectPath, "src/api")) || await fs.pathExists(path.join(projectPath, "src-ts/impl/api"));
120
120
  const hasPg = "pg" in deps || "@neondatabase/serverless" in deps;
121
121
  const hasMysql = "mysql" in deps || "mysql2" in deps;
122
122
  const hasSqlite = "sqlite" in deps || "sqlite3" in deps || "better-sqlite3" in deps;
@@ -190,7 +190,7 @@ export async function detectFeatures(projectPath, packageJson) {
190
190
  const hasHono = "hono" in deps;
191
191
  const hasTrpc = "@trpc/server" in deps;
192
192
  const hasGraphql = "graphql" in deps || "apollo-server" in deps;
193
- const hasRest = await fs.pathExists(path.join(projectPath, "src/api")) || await fs.pathExists(path.join(projectPath, "src-ts/app/api"));
193
+ const hasRest = await fs.pathExists(path.join(projectPath, "src/api")) || await fs.pathExists(path.join(projectPath, "src-ts/impl/api"));
194
194
  const hasEslint = "eslint" in deps;
195
195
  const hasBiome = "@biomejs/biome" in deps;
196
196
  const hasStripe = "stripe" in deps || "@stripe/stripe-js" in deps;
@@ -804,7 +804,7 @@ function getBumpFilter(isDev) {
804
804
  return isDev ? `[
805
805
  "package.json",
806
806
  "reliverse.ts",
807
- "src-ts/app/config/info.ts",
807
+ "src-ts/impl/config/info.ts",
808
808
  ]` : `["package.json", "reliverse.ts"]`;
809
809
  }
810
810
  function getPublishArtifacts(isDev) {
@@ -11,7 +11,7 @@ import {
11
11
  setupDrizzle
12
12
  } from "./manageDrizzleSchemaUtils.js";
13
13
  export async function manageDrizzleSchema(cwd, isDev) {
14
- const singleSchemaDir = isDev ? path.join(cwd, "src-ts/app/db") : path.join(cwd, "src/db");
14
+ const singleSchemaDir = isDev ? path.join(cwd, "src-ts/impl/db") : path.join(cwd, "src/db");
15
15
  const multiSchemaDir = path.join(singleSchemaDir, "schema");
16
16
  let provider = await detectDatabaseProvider(cwd);
17
17
  if (!provider) {
@@ -347,7 +347,7 @@ export const INTEGRATION_CONFIGS = {
347
347
  } = authClient;`
348
348
  },
349
349
  {
350
- path: "src-ts/app/auth/sign-in/page.tsx",
350
+ path: "src-ts/impl/auth/sign-in/page.tsx",
351
351
  content: `"use client";
352
352
  import { useState } from "react";
353
353
  import { authClient } from "@/lib/auth-client";
@@ -430,7 +430,7 @@ export const INTEGRATION_CONFIGS = {
430
430
  }`
431
431
  },
432
432
  {
433
- path: "src-ts/app/auth/error/page.tsx",
433
+ path: "src-ts/impl/auth/error/page.tsx",
434
434
  content: `"use client";
435
435
  import { useSearchParams } from "next/navigation";
436
436
  export default function AuthErrorPage() {
@@ -29,11 +29,11 @@ export const REMOVAL_CONFIGS = {
29
29
  files: [
30
30
  "src/lib/auth.ts",
31
31
  "src/lib/auth-client.ts",
32
- "src-ts/app/api/auth/[...nextauth]/route.ts",
33
- "src-ts/app/api/auth/[...all]/route.ts",
32
+ "src-ts/impl/api/auth/[...nextauth]/route.ts",
33
+ "src-ts/impl/api/auth/[...all]/route.ts",
34
34
  "middleware.ts"
35
35
  ],
36
- directories: ["src-ts/app/api/auth"],
36
+ directories: ["src-ts/impl/api/auth"],
37
37
  scripts: ["db:generate", "db:migrate"],
38
38
  envVars: [
39
39
  "NEXTAUTH_SECRET",
@@ -54,8 +54,8 @@ export const REMOVAL_CONFIGS = {
54
54
  name: "Payments",
55
55
  dependencies: ["stripe", "@polar-sh/sdk"],
56
56
  devDependencies: [],
57
- files: ["src/lib/stripe.ts", "src-ts/app/api/stripe/webhook/route.ts"],
58
- directories: ["src-ts/app/api/stripe"],
57
+ files: ["src/lib/stripe.ts", "src-ts/impl/api/stripe/webhook/route.ts"],
58
+ directories: ["src-ts/impl/api/stripe"],
59
59
  scripts: [],
60
60
  envVars: ["STRIPE_SECRET_KEY", "STRIPE_WEBHOOK_SECRET", "STRIPE_PRICE_ID", "POLAR_TOKEN"]
61
61
  },
@@ -70,7 +70,7 @@ export async function initializeProjectConfig(projectName, _memory, config, skip
70
70
  };
71
71
  }
72
72
  export async function setupI18nSupport(projectPath, config) {
73
- const i18nFolderExists = await fs.pathExists(path.join(projectPath, "src-ts/app/[locale]")) || await fs.pathExists(path.join(projectPath, "src-ts/app/[lang]"));
73
+ const i18nFolderExists = await fs.pathExists(path.join(projectPath, "src-ts/impl/[locale]")) || await fs.pathExists(path.join(projectPath, "src-ts/impl/[lang]"));
74
74
  if (i18nFolderExists) {
75
75
  relinka("verbose", "i18n is already enabled in the template. No changes needed.");
76
76
  return true;
@@ -2,7 +2,7 @@ import path from "@reliverse/pathkit";
2
2
  import { re } from "@reliverse/relico";
3
3
  import fs from "@reliverse/relifso";
4
4
  import { relinka } from "@reliverse/relinka";
5
- import { deleteLastLine, inputPrompt, selectPrompt } from "@reliverse/rempts";
5
+ import { inputPrompt, selectPrompt } from "@reliverse/rempts";
6
6
  import { simpleGit } from "simple-git";
7
7
  import { cliName } from "../../../../config/constants.js";
8
8
  import { getEffectiveDir } from "../../../../utils/getEffectiveDir.js";
@@ -39,7 +39,6 @@ export async function initializeGitRepo(git, alreadyGit, config, isTemplateDownl
39
39
  }
40
40
  if (!alreadyGit) {
41
41
  await git.init();
42
- deleteLastLine();
43
42
  relinka("success", "Git repository initialized");
44
43
  const branchName = config.repoBranch && config.repoBranch !== "main" ? config.repoBranch : "main";
45
44
  try {
@@ -94,7 +93,6 @@ export async function initGitDir(params) {
94
93
  params.projectPath
95
94
  );
96
95
  if (alreadyGit && params.allowReInit) {
97
- deleteLastLine();
98
96
  relinka("verbose", "Reinitializing existing git repository...");
99
97
  if (!await removeGitDir(effectiveDir)) return false;
100
98
  const git2 = simpleGit({ baseDir: effectiveDir });
@@ -1,7 +1,7 @@
1
1
  import { setTimeout } from "node:timers";
2
2
  import { re } from "@reliverse/relico";
3
3
  import { relinka } from "@reliverse/relinka";
4
- import { useSpinner } from "@reliverse/rempts";
4
+ import { createSpinner } from "@reliverse/rempts";
5
5
  import { listen } from "async-listen";
6
6
  import http from "http";
7
7
  import { customAlphabet } from "nanoid";
@@ -19,7 +19,7 @@ class UserCancellationError extends Error {
19
19
  const nanoid = customAlphabet("123456789QAZWSXEDCRFVTGBYHNUJMIKOLP", 5);
20
20
  export async function auth({ isDev, useLocalhost }) {
21
21
  relinka("info", "Let's authenticate you...");
22
- const spinner = useSpinner({
22
+ const spinner = createSpinner({
23
23
  text: "Waiting for user confirmation..."
24
24
  }).start();
25
25
  try {
@@ -113,9 +113,7 @@ export async function auth({ isDev, useLocalhost }) {
113
113
  confirmationUrl.toString()
114
114
  );
115
115
  }
116
- spinner.setText(
117
- ` Please visit it and confirm there if you see the same code: ${re.bold(code)}`
118
- );
116
+ spinner.text = ` Please visit it and confirm there if you see the same code: ${re.bold(code)}`;
119
117
  const authTimeout = setTimeout(
120
118
  () => {
121
119
  relinka("error", "Authentication timed out.");
@@ -141,13 +139,13 @@ export async function auth({ isDev, useLocalhost }) {
141
139
  relinka("verbose", "Wrote auth data to memory. To view it, type:", `code ${memoryPath}`);
142
140
  relinka("verbose", "Local server closed after successful authentication.");
143
141
  });
144
- spinner.stop();
142
+ spinner.succeed("Authenticated!");
145
143
  relinka("log", cliDomainDocs);
146
144
  return;
147
145
  } catch (error) {
148
146
  clearTimeout(authTimeout);
149
147
  if (error instanceof UserCancellationError) {
150
- spinner.setText("Login cancelled. See you next time \u{1F44B}");
148
+ spinner.text = "Login cancelled. See you next time \u{1F44B}";
151
149
  server.close(() => {
152
150
  relinka("verbose", "Local server closed due to user cancellation.");
153
151
  process.exit(0);
@@ -156,12 +154,12 @@ export async function auth({ isDev, useLocalhost }) {
156
154
  server.close(() => {
157
155
  relinka("verbose", "Local server closed due to authentication failure.");
158
156
  });
159
- spinner.stop();
157
+ spinner.fail("Authentication failed");
160
158
  throw error;
161
159
  }
162
160
  }
163
161
  } catch (error) {
164
- spinner.stop();
162
+ spinner.fail("Authentication failed");
165
163
  relinka("error", "Authentication failed!");
166
164
  throw error;
167
165
  }
@@ -2,6 +2,7 @@ import path from "@reliverse/pathkit";
2
2
  import { glob } from "@reliverse/reglob";
3
3
  import fs from "@reliverse/relifso";
4
4
  import { relinka } from "@reliverse/relinka";
5
+ import { withEnhancedSpinner } from "@reliverse/rempts";
5
6
  import MagicString, { Bundle } from "magic-string";
6
7
  import pMap from "p-map";
7
8
  import { isBinaryExt } from "../utils/binary.js";
@@ -16,7 +17,6 @@ import {
16
17
  validateMergeOperation,
17
18
  validatePath
18
19
  } from "../utils/utils-security.js";
19
- import { withEnhancedSpinner } from "../utils/spinner.js";
20
20
  export const DEFAULT_IGNORES = ["**/.git/**", "**/node_modules/**"];
21
21
  export const DEFAULT_SEPARATOR_RAW = "\\n\\n";
22
22
  export const normalizeGlobPattern = (pattern) => {
@@ -397,7 +397,7 @@ compilerOptions = "tsconfig.json"
397
397
  const generateDockerfile = (analysis) => {
398
398
  return `# Use Bun's official image
399
399
  FROM oven/bun:1 as base
400
- WORKDIR /usr/src-ts/app
400
+ WORKDIR /usr/src/app
401
401
  # Install dependencies
402
402
  COPY package.json bun.lock* ./
403
403
  RUN bun install --frozen-lockfile
@@ -2,23 +2,24 @@ import path from "node:path";
2
2
  import { re } from "@reliverse/relico";
3
3
  import fs from "@reliverse/relifso";
4
4
  import { relinka } from "@reliverse/relinka";
5
- import { cancel, inputPrompt, isCancel, spinner } from "@reliverse/rempts";
5
+ import { cancel, createSpinner, inputPrompt, isCancel } from "@reliverse/rempts";
6
6
  import { execa } from "execa";
7
7
  import {
8
8
  addEnvVariablesToFile
9
9
  } from "../project-generation/env-setup.js";
10
10
  import { commandExists } from "../../utils/command-exists.js";
11
11
  async function checkAtlasCLI() {
12
- const s = spinner({
12
+ const s = createSpinner({
13
13
  text: "Checking for MongoDB Atlas CLI..."
14
14
  });
15
15
  s.start("Checking for MongoDB Atlas CLI...");
16
16
  try {
17
17
  const exists = await commandExists("atlas");
18
- s.stop(exists ? "MongoDB Atlas CLI found" : re.yellow("MongoDB Atlas CLI not found"));
18
+ if (exists) s.succeed("MongoDB Atlas CLI found");
19
+ else s.fail(re.yellow("MongoDB Atlas CLI not found"));
19
20
  return exists;
20
21
  } catch (_error) {
21
- s.stop(re.red("Error checking MongoDB Atlas CLI"));
22
+ s.fail(re.red("Error checking MongoDB Atlas CLI"));
22
23
  return false;
23
24
  }
24
25
  }
@@ -98,14 +99,14 @@ ${re.green("MongoDB Atlas Manual Setup Instructions:")}
98
99
  }
99
100
  export async function setupMongoDBAtlas(config) {
100
101
  const { projectDir } = config;
101
- const mainSpinner = spinner({
102
+ const mainSpinner = createSpinner({
102
103
  text: "Setting up MongoDB Atlas..."
103
104
  });
104
105
  mainSpinner.start("Setting up MongoDB Atlas...");
105
106
  const serverDir = path.join(projectDir, "apps/server");
106
107
  try {
107
108
  await fs.ensureDir(serverDir);
108
- mainSpinner.stop("MongoDB Atlas setup ready");
109
+ mainSpinner.succeed("MongoDB Atlas setup ready");
109
110
  const config2 = await initMongoDBAtlas(serverDir);
110
111
  if (config2) {
111
112
  await writeEnvFile(projectDir, config2);
@@ -116,7 +117,7 @@ export async function setupMongoDBAtlas(config) {
116
117
  displayManualSetupInstructions();
117
118
  }
118
119
  } catch (error) {
119
- mainSpinner.stop(re.red("MongoDB Atlas setup failed"));
120
+ mainSpinner.fail(re.red("MongoDB Atlas setup failed"));
120
121
  relinka(
121
122
  "error",
122
123
  re.red(
@@ -2,7 +2,7 @@ import path from "node:path";
2
2
  import { re } from "@reliverse/relico";
3
3
  import fs from "@reliverse/relifso";
4
4
  import { relinka } from "@reliverse/relinka";
5
- import { cancel, isCancel, select, spinner, text } from "@reliverse/rempts";
5
+ import { cancel, createSpinner, isCancel, select, text } from "@reliverse/rempts";
6
6
  import { execa } from "execa";
7
7
  import {
8
8
  addEnvVariablesToFile
@@ -18,17 +18,18 @@ const NEON_REGIONS = [
18
18
  { label: "Azure East US 2 region (Virginia)", value: "azure-eastus2" }
19
19
  ];
20
20
  async function executeNeonCommand(packageManager, commandArgsString, spinnerText) {
21
- const s = spinner({
21
+ const s = createSpinner({
22
22
  text: spinnerText ?? `Running ${packageManager} command...`
23
23
  });
24
24
  try {
25
25
  const fullCommand = getPackageExecutionCommand(packageManager, commandArgsString);
26
26
  if (spinnerText) s.start(spinnerText);
27
27
  const result = await execa(fullCommand, { shell: true });
28
- if (spinnerText) s.stop(re.green(spinnerText.replace("...", "").replace("ing ", "ed ").trim()));
28
+ if (spinnerText)
29
+ s.succeed(re.green(spinnerText.replace("...", "").replace("ing ", "ed ").trim()));
29
30
  return result;
30
31
  } catch (error) {
31
- if (s) s.stop(re.red(`Failed: ${spinnerText || "Command execution"}`));
32
+ if (s) s.fail(re.red(`Failed: ${spinnerText || "Command execution"}`));
32
33
  throw error;
33
34
  }
34
35
  }
@@ -72,7 +73,7 @@ async function writeEnvFile(projectDir, config) {
72
73
  }
73
74
  async function setupWithNeonDb(projectDir, packageManager) {
74
75
  try {
75
- const s = spinner({
76
+ const s = createSpinner({
76
77
  text: "Creating Neon database using neondb..."
77
78
  });
78
79
  s.start("Creating Neon database using neondb...");
@@ -83,7 +84,7 @@ async function setupWithNeonDb(projectDir, packageManager) {
83
84
  shell: true,
84
85
  cwd: serverDir
85
86
  });
86
- s.stop(re.green("Neon database created successfully!"));
87
+ s.succeed(re.green("Neon database created successfully!"));
87
88
  return true;
88
89
  } catch (error) {
89
90
  relinka("error", re.red("Failed to create database with neondb"));
@@ -149,13 +150,13 @@ export async function setupNeonPostgres(config) {
149
150
  if (!neonConfig) {
150
151
  throw new Error("Failed to create project - couldn't get connection information");
151
152
  }
152
- const finalSpinner = spinner({
153
+ const finalSpinner = createSpinner({
153
154
  text: "Configuring database connection"
154
155
  });
155
156
  finalSpinner.start("Configuring database connection");
156
157
  await fs.ensureDir(path.join(projectDir, "apps/server"));
157
158
  await writeEnvFile(projectDir, neonConfig);
158
- finalSpinner.stop("Neon database configured!");
159
+ finalSpinner.succeed("Neon database configured!");
159
160
  }
160
161
  } catch (error) {
161
162
  if (error instanceof Error) {
@@ -2,7 +2,7 @@ import path from "node:path";
2
2
  import { re } from "@reliverse/relico";
3
3
  import fs from "@reliverse/relifso";
4
4
  import { relinka } from "@reliverse/relinka";
5
- import { cancel, isCancel, password, spinner } from "@reliverse/rempts";
5
+ import { cancel, createSpinner, isCancel, password } from "@reliverse/rempts";
6
6
  import { execa } from "execa";
7
7
  import {
8
8
  addEnvVariablesToFile
@@ -10,14 +10,14 @@ import {
10
10
  import { addPackageDependency } from "../../utils/add-package-deps.js";
11
11
  import { getPackageExecutionCommand } from "../../utils/get-package-execution-command.js";
12
12
  async function initPrismaDatabase(serverDir, packageManager) {
13
- const s = spinner({
13
+ const s = createSpinner({
14
14
  text: "Initializing Prisma PostgreSQL..."
15
15
  });
16
16
  try {
17
17
  s.start("Initializing Prisma PostgreSQL...");
18
18
  const prismaDir = path.join(serverDir, "prisma");
19
19
  await fs.ensureDir(prismaDir);
20
- s.stop("Prisma PostgreSQL initialized. Follow the prompts below:");
20
+ s.succeed("Prisma PostgreSQL initialized. Follow the prompts below:");
21
21
  const prismaInitCommand = getPackageExecutionCommand(packageManager, "prisma init --db");
22
22
  await execa(prismaInitCommand, {
23
23
  cwd: serverDir,
@@ -47,7 +47,7 @@ async function initPrismaDatabase(serverDir, packageManager) {
47
47
  databaseUrl
48
48
  };
49
49
  } catch (error) {
50
- s.stop(re.red("Prisma PostgreSQL initialization failed"));
50
+ s.fail(re.red("Prisma PostgreSQL initialization failed"));
51
51
  if (error instanceof Error) {
52
52
  relinka("error", error.message);
53
53
  }
@@ -116,13 +116,13 @@ ${dbFileContent}`;
116
116
  export async function setupPrismaPostgres(config) {
117
117
  const { packageManager, projectDir } = config;
118
118
  const serverDir = path.join(projectDir, "apps/server");
119
- const s = spinner({
119
+ const s = createSpinner({
120
120
  text: "Setting up Prisma PostgreSQL..."
121
121
  });
122
122
  s.start("Setting up Prisma PostgreSQL...");
123
123
  try {
124
124
  await fs.ensureDir(serverDir);
125
- s.stop("Prisma PostgreSQL setup ready");
125
+ s.succeed("Prisma PostgreSQL setup ready");
126
126
  const config2 = await initPrismaDatabase(serverDir, packageManager);
127
127
  if (config2) {
128
128
  await writeEnvFile(projectDir, config2);
@@ -135,16 +135,16 @@ export async function setupPrismaPostgres(config) {
135
135
  )
136
136
  );
137
137
  } else {
138
- const fallbackSpinner = spinner({
138
+ const fallbackSpinner = createSpinner({
139
139
  text: "Setting up fallback configuration..."
140
140
  });
141
141
  fallbackSpinner.start("Setting up fallback configuration...");
142
142
  await writeEnvFile(projectDir);
143
- fallbackSpinner.stop("Fallback configuration ready");
143
+ fallbackSpinner.succeed("Fallback configuration ready");
144
144
  displayManualSetupInstructions();
145
145
  }
146
146
  } catch (error) {
147
- s.stop(re.red("Prisma PostgreSQL setup failed"));
147
+ s.fail(re.red("Prisma PostgreSQL setup failed"));
148
148
  relinka(
149
149
  "error",
150
150
  re.red(