@reliverse/dler 1.7.129 → 1.7.131

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.
@@ -5,7 +5,15 @@ import type { PerfTimer } from "../types/mod.js";
5
5
  * Handles building for both main project and libraries.
6
6
  * @see `src-ts/impl/pub/impl.ts` for pub main function implementation.
7
7
  */
8
- export declare function dlerBuild(timer: PerfTimer, isDev: boolean, config?: ReliverseConfig, debugOnlyCopyNonBuildFiles?: boolean, debugDontCopyNonBuildFiles?: boolean, disableOwnSpinner?: boolean): Promise<{
8
+ export declare function dlerBuild({ flow, timer, isDev, config, debugOnlyCopyNonBuildFiles, debugDontCopyNonBuildFiles, disableOwnSpinner, }: {
9
+ flow: "build" | "pub";
10
+ timer: PerfTimer;
11
+ isDev: boolean;
12
+ config?: ReliverseConfig;
13
+ debugOnlyCopyNonBuildFiles?: boolean;
14
+ debugDontCopyNonBuildFiles?: boolean;
15
+ disableOwnSpinner?: boolean;
16
+ }): Promise<{
9
17
  timer: PerfTimer;
10
18
  effectiveConfig: any;
11
19
  } | undefined>;
@@ -9,9 +9,18 @@ import { PROJECT_ROOT } from "../config/constants.js";
9
9
  import { getConfigDler } from "../config/load.js";
10
10
  import { removeDistFolders } from "../utils/utils-clean.js";
11
11
  import { handleDlerError } from "../utils/utils-error-cwd.js";
12
+ import { createCompletionTexts } from "../utils/finish-text.js";
12
13
  import { dlerPostBuild, wrapper_CopyNonBuildFiles } from "./postbuild.js";
13
14
  import { dlerPreBuild } from "./prebuild.js";
14
- export async function dlerBuild(timer, isDev, config, debugOnlyCopyNonBuildFiles, debugDontCopyNonBuildFiles, disableOwnSpinner) {
15
+ export async function dlerBuild({
16
+ flow,
17
+ timer,
18
+ isDev,
19
+ config,
20
+ debugOnlyCopyNonBuildFiles,
21
+ debugDontCopyNonBuildFiles,
22
+ disableOwnSpinner
23
+ }) {
15
24
  let effectiveConfig = config;
16
25
  let shouldShowSpinner = false;
17
26
  let multiStepSpinner = null;
@@ -76,8 +85,13 @@ export async function dlerBuild(timer, isDev, config, debugOnlyCopyNonBuildFiles
76
85
  if (effectiveConfig.postBuildSettings?.deleteDistTmpAfterBuild) {
77
86
  await fs.remove(path.join(PROJECT_ROOT, "dist-tmp"));
78
87
  }
79
- if (multiStepSpinner) {
80
- multiStepSpinner.complete("Build completed successfully");
88
+ if (flow === "build") {
89
+ const { plain, withEmoji } = await createCompletionTexts(effectiveConfig, timer, "build");
90
+ if (multiStepSpinner) {
91
+ multiStepSpinner.complete(plain);
92
+ } else {
93
+ relinka("success", withEmoji);
94
+ }
81
95
  }
82
96
  return { timer, effectiveConfig };
83
97
  } catch (error) {
@@ -1,5 +1,5 @@
1
1
  export declare const PROJECT_ROOT: string;
2
- export declare const cliVersion = "1.7.129";
2
+ export declare const cliVersion = "1.7.131";
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.129";
4
+ const version = "1.7.131";
5
5
  export const cliVersion = version;
6
6
  export const cliName = "@reliverse/rse";
7
7
  export const rseName = "@reliverse/rse";
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  export declare const DatabaseSchema: z.ZodEnum<{
3
- none: "none";
4
3
  sqlite: "sqlite";
4
+ none: "none";
5
5
  mysql: "mysql";
6
6
  mongodb: "mongodb";
7
7
  postgres: "postgres";
@@ -10,23 +10,23 @@ export type Database = z.infer<typeof DatabaseSchema>;
10
10
  export declare const ORMSchema: z.ZodEnum<{
11
11
  none: "none";
12
12
  drizzle: "drizzle";
13
- mongoose: "mongoose";
14
13
  prisma: "prisma";
14
+ mongoose: "mongoose";
15
15
  }>;
16
16
  export type ORM = z.infer<typeof ORMSchema>;
17
17
  export declare const BackendSchema: z.ZodEnum<{
18
18
  none: "none";
19
19
  hono: "hono";
20
20
  next: "next";
21
- convex: "convex";
22
21
  express: "express";
23
22
  fastify: "fastify";
24
23
  elysia: "elysia";
24
+ convex: "convex";
25
25
  }>;
26
26
  export type Backend = z.infer<typeof BackendSchema>;
27
27
  export declare const RuntimeSchema: z.ZodEnum<{
28
- none: "none";
29
28
  bun: "bun";
29
+ none: "none";
30
30
  node: "node";
31
31
  workers: "workers";
32
32
  }>;
@@ -45,8 +45,8 @@ export declare const FrontendSchema: z.ZodEnum<{
45
45
  }>;
46
46
  export type Frontend = z.infer<typeof FrontendSchema>;
47
47
  export declare const AddonsSchema: z.ZodEnum<{
48
- none: "none";
49
48
  biome: "biome";
49
+ none: "none";
50
50
  tauri: "tauri";
51
51
  starlight: "starlight";
52
52
  turborepo: "turborepo";
@@ -55,9 +55,9 @@ export declare const AddonsSchema: z.ZodEnum<{
55
55
  }>;
56
56
  export type Addons = z.infer<typeof AddonsSchema>;
57
57
  export declare const ExamplesSchema: z.ZodEnum<{
58
+ ai: "ai";
58
59
  none: "none";
59
60
  todo: "todo";
60
- ai: "ai";
61
61
  }>;
62
62
  export type Examples = z.infer<typeof ExamplesSchema>;
63
63
  export declare const PackageManagerSchema: z.ZodEnum<{
@@ -1,14 +1,13 @@
1
1
  import { bumpHandler, isBumpDisabled, setBumpDisabledValueTo } from "@reliverse/bleump";
2
2
  import { relinka } from "@reliverse/relinka";
3
3
  import { createMultiStepSpinner } from "@reliverse/rempts";
4
- import prettyMilliseconds from "pretty-ms";
5
4
  import { dlerBuild } from "../build/impl.js";
6
5
  import { library_pubFlow } from "../build/library-flow.js";
7
6
  import { regular_pubFlow } from "../build/regular-flow.js";
8
7
  import { getConfigDler } from "../config/load.js";
9
8
  import { finalizeBuild, finalizePub } from "../utils/finalize.js";
10
9
  import { handleDlerError } from "../utils/utils-error-cwd.js";
11
- import { getElapsedPerfTime } from "../utils/utils-perf.js";
10
+ import { createCompletionTexts } from "../utils/finish-text.js";
12
11
  export async function dlerPub(timer, isDev, config) {
13
12
  let effectiveConfig = config;
14
13
  let shouldShowSpinner = false;
@@ -42,20 +41,24 @@ export async function dlerPub(timer, isDev, config) {
42
41
  }
43
42
  }
44
43
  if (multiStepSpinner) multiStepSpinner.nextStep();
45
- const { effectiveConfig: buildConfig } = await dlerBuild(
44
+ const { effectiveConfig: buildConfig } = await dlerBuild({
45
+ flow: "pub",
46
46
  timer,
47
47
  isDev,
48
- effectiveConfig,
49
- void 0,
50
- void 0,
51
- shouldShowSpinner
48
+ config: effectiveConfig,
49
+ debugOnlyCopyNonBuildFiles: false,
50
+ debugDontCopyNonBuildFiles: false,
51
+ disableOwnSpinner: true
52
52
  // disable build's spinner if pub is showing one
53
- );
53
+ });
54
54
  if (multiStepSpinner) multiStepSpinner.nextStep();
55
55
  if (effectiveConfig.commonPubPause) {
56
56
  await finalizeBuild(shouldShowSpinner, timer, effectiveConfig.commonPubPause, "pub");
57
+ const buildTexts = await createCompletionTexts(buildConfig, timer, "build");
57
58
  if (multiStepSpinner) {
58
- multiStepSpinner.complete("Build completed successfully");
59
+ multiStepSpinner.complete(buildTexts.plain);
60
+ } else {
61
+ relinka("success", buildTexts.withEmoji);
59
62
  }
60
63
  } else {
61
64
  await regular_pubFlow(timer, isDev, buildConfig);
@@ -67,45 +70,11 @@ export async function dlerPub(timer, isDev, config) {
67
70
  buildConfig.distJsrDirName,
68
71
  buildConfig.libsDirDist
69
72
  );
70
- const elapsedTime = getElapsedPerfTime(timer);
71
- const formattedPerfTime = prettyMilliseconds(elapsedTime, { verbose: true });
72
- const packageName = buildConfig.projectName ?? "The project";
73
- const versionLabelMain = buildConfig.version ? ` v${buildConfig.version}` : "";
74
- const publishedLibNames = (() => {
75
- const includeLibs = buildConfig.libsActMode === "libs-only" || buildConfig.libsActMode === "main-and-libs";
76
- if (!includeLibs || buildConfig.commonPubPause) return [];
77
- const entries = Object.entries(buildConfig.libsList ?? {});
78
- const names = [];
79
- for (const [libName, libCfg] of entries) {
80
- if (!libCfg?.libPubPause) {
81
- const libVersionLabel = libCfg?.version ? ` v${libCfg.version}` : versionLabelMain;
82
- names.push(`${libName}${libVersionLabel}`);
83
- }
84
- }
85
- return names;
86
- })();
87
- const displayName = publishedLibNames.length > 0 ? publishedLibNames.join(", ") : `${packageName}${versionLabelMain}`;
88
- const publishTargetLabel = (() => {
89
- switch (buildConfig.commonPubRegistry) {
90
- case "npm":
91
- return "to NPM";
92
- case "jsr":
93
- return "to JSR";
94
- case "npm-jsr":
95
- return "to NPM and JSR";
96
- default:
97
- return "to NPM and JSR";
98
- }
99
- })();
73
+ const publishTexts = await createCompletionTexts(buildConfig, timer, "publish");
100
74
  if (multiStepSpinner) {
101
- multiStepSpinner.complete(
102
- `${displayName} publish ${publishTargetLabel} completed successfully in ${formattedPerfTime}`
103
- );
75
+ multiStepSpinner.complete(publishTexts.plain);
104
76
  } else {
105
- relinka(
106
- "success",
107
- `\u2705 ${displayName} publish ${publishTargetLabel} completed successfully in ${formattedPerfTime}`
108
- );
77
+ relinka("success", publishTexts.withEmoji);
109
78
  }
110
79
  }
111
80
  } catch (error) {
@@ -0,0 +1,6 @@
1
+ import type { ReliverseConfig } from "../schema/mod";
2
+ import type { PerfTimer } from "../types/mod";
3
+ export declare function createCompletionTexts(buildConfig: ReliverseConfig, timer: PerfTimer, action: "build" | "publish"): Promise<{
4
+ plain: string;
5
+ withEmoji: string;
6
+ }>;
@@ -0,0 +1,41 @@
1
+ import prettyMilliseconds from "pretty-ms";
2
+ import { PROJECT_ROOT } from "../config/constants.js";
3
+ import { getPackageJson } from "../config/detect.js";
4
+ import { getElapsedPerfTime } from "../utils/utils-perf.js";
5
+ export async function createCompletionTexts(buildConfig, timer, action) {
6
+ const elapsedTime = getElapsedPerfTime(timer);
7
+ const formattedPerfTime = prettyMilliseconds(elapsedTime, { verbose: true });
8
+ const pkgJson = await getPackageJson(PROJECT_ROOT);
9
+ const packageName = pkgJson?.name ?? buildConfig.projectName ?? "The project";
10
+ const versionFromPkg = pkgJson?.version;
11
+ const versionLabelMain = versionFromPkg ?? buildConfig.version ? ` v${versionFromPkg ?? buildConfig.version}` : "";
12
+ const includeLibs = buildConfig.libsActMode === "libs-only" || buildConfig.libsActMode === "main-and-libs";
13
+ const namesForAction = (() => {
14
+ if (!includeLibs) return [];
15
+ const entries = Object.entries(buildConfig.libsList ?? {});
16
+ const names = [];
17
+ for (const [libName, libCfg] of entries) {
18
+ if (action === "publish") {
19
+ if (buildConfig.commonPubPause || libCfg?.libPubPause) continue;
20
+ }
21
+ const libVersionLabel = libCfg?.version ? ` v${libCfg.version}` : versionLabelMain;
22
+ names.push(`${libName}${libVersionLabel}`);
23
+ }
24
+ return names;
25
+ })();
26
+ const displayName = namesForAction.length > 0 ? namesForAction.join(", ") : `${packageName}${versionLabelMain}`;
27
+ const publishTargetLabel = (() => {
28
+ switch (buildConfig.commonPubRegistry) {
29
+ case "npm":
30
+ return "to NPM";
31
+ case "jsr":
32
+ return "to JSR";
33
+ case "npm-jsr":
34
+ return "to NPM and JSR";
35
+ default:
36
+ return "to NPM and JSR";
37
+ }
38
+ })();
39
+ const base = action === "build" ? `${displayName} build completed successfully in ${formattedPerfTime}` : `${displayName} publish ${publishTargetLabel} completed successfully in ${formattedPerfTime}`;
40
+ return { plain: base, withEmoji: `\u2705 ${base}` };
41
+ }
package/package.json CHANGED
@@ -123,7 +123,7 @@
123
123
  "license": "MIT",
124
124
  "name": "@reliverse/dler",
125
125
  "type": "module",
126
- "version": "1.7.129",
126
+ "version": "1.7.131",
127
127
  "author": "reliverse",
128
128
  "bugs": {
129
129
  "email": "blefnk@gmail.com",