@reliverse/dler 1.7.86 → 1.7.87

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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [sponsor](https://github.com/sponsors/blefnk) — [discord](https://discord.gg/pb8ukbwpsj) — [github](https://github.com/reliverse/dler) — [npm](https://npmjs.com/@reliverse/dler)
4
4
 
5
- > @reliverse/dler (formerly relidler; `/ˈdiː.lər/`, dealer) is a unified package manager for typescript/javascript projects.
5
+ > @reliverse/dler (formerly relidler; `/ˈdiː.lər/`, dealer) is both a unified package manager for typescript/javascript projects and a flexible framework for creating, building, and publishing js/ts libraries to npm and jsr.
6
6
  >
7
7
  > dler is your package manager’s best friend — it extends bun, deno (🔜), pnpm, yarn, and npm with powerful and modern features.
8
8
  >
@@ -1,3 +1,111 @@
1
+ /** Configuration for directory-related settings. */
2
+ export interface RelinkaDirsConfig {
3
+ maxLogFiles?: number;
4
+ }
5
+ /** Log level types used by the logger. */
6
+ export type LogLevel = "error" | "fatal" | "info" | "success" | "verbose" | "warn" | "log" | "internal" | "null" | "step" | "box" | "message";
7
+ /** Configuration for a single log level. */
8
+ export interface LogLevelConfig {
9
+ /**
10
+ * Symbol to display for this log level.
11
+ * @see https://symbl.cc
12
+ */
13
+ symbol: string;
14
+ /**
15
+ * Fallback symbol to use if Unicode is not supported.
16
+ */
17
+ fallbackSymbol: string;
18
+ /**
19
+ * Color to use for this log level.
20
+ */
21
+ color: string;
22
+ /**
23
+ * Number of spaces after the symbol/fallback
24
+ */
25
+ spacing?: number;
26
+ }
27
+ /** Configuration for all log levels. */
28
+ export type LogLevelsConfig = Partial<Record<LogLevel, LogLevelConfig>>;
29
+ /**
30
+ * Configuration options for the Relinka logger.
31
+ * All properties are optional to allow for partial configuration.
32
+ * Defaults will be applied during initialization.
33
+ */
34
+ export interface RelinkaConfig {
35
+ /**
36
+ * Enables verbose (aka debug) mode for detailed logging.
37
+ *
38
+ * `true` here works only for end-users of CLIs/libs when theirs developers
39
+ * has been awaited for user's config via `@reliverse/relinka`'s `await relinkaConfig;`
40
+ */
41
+ verbose?: boolean;
42
+ /**
43
+ * Configuration for directory-related settings.
44
+ * - `maxLogFiles`: The maximum number of log files to keep before cleanup.
45
+ */
46
+ dirs?: RelinkaDirsConfig;
47
+ /**
48
+ * Disables color output in the console.
49
+ */
50
+ disableColors?: boolean;
51
+ /**
52
+ * Configuration for log file output.
53
+ */
54
+ logFile?: {
55
+ /**
56
+ * Path to the log file.
57
+ */
58
+ outputPath?: string;
59
+ /**
60
+ * How to handle date in the filename.
61
+ * - `disable`: No date prefix/suffix
62
+ * - `append-before`: Add date before the filename (e.g., "2024-01-15-log.txt")
63
+ * - `append-after`: Add date after the filename (e.g., "log-2024-01-15.txt")
64
+ */
65
+ nameWithDate?: "disable" | "append-before" | "append-after";
66
+ /**
67
+ * If true, clears the log file when relinkaConfig is executed with supportFreshLogFile: true.
68
+ * This is useful for starting with a clean log file on each run.
69
+ */
70
+ freshLogFile?: boolean;
71
+ };
72
+ /**
73
+ * If true, logs will be saved to a file.
74
+ */
75
+ saveLogsToFile?: boolean;
76
+ /**
77
+ * Configuration for timestamp in log messages.
78
+ */
79
+ timestamp?: {
80
+ /**
81
+ * If true, timestamps will be added to log messages.
82
+ */
83
+ enabled: boolean;
84
+ /**
85
+ * The format for timestamps. Default is YYYY-MM-DD HH:mm:ss.SSS
86
+ */
87
+ format?: string;
88
+ };
89
+ /**
90
+ * Allows to customize the log levels.
91
+ */
92
+ levels?: LogLevelsConfig;
93
+ /**
94
+ * Controls how often the log cleanup runs (in milliseconds)
95
+ * Default: 10000 (10 seconds)
96
+ */
97
+ cleanupInterval?: number;
98
+ /**
99
+ * Maximum size of the log write buffer before flushing to disk (in bytes)
100
+ * Default: 4096 (4KB)
101
+ */
102
+ bufferSize?: number;
103
+ /**
104
+ * Maximum time to hold logs in buffer before flushing to disk (in milliseconds)
105
+ * Default: 5000 (5 seconds)
106
+ */
107
+ maxBufferAge?: number;
108
+ }
1
109
  /**
2
110
  * Defines the configuration for building and publishing packages. This includes: versioning,
3
111
  * build settings, publishing options, libraries-dler-plugin built-in plugin, and more.
@@ -504,6 +612,13 @@ export interface DlerConfig {
504
612
  * @default "templates"
505
613
  */
506
614
  buildTemplatesDir: string;
615
+ /**
616
+ * Integrated relinka logger configuration.
617
+ * @see https://github.com/reliverse/relinka
618
+ *
619
+ * @default See DEFAULT_RELINKA_CONFIG in defaults
620
+ */
621
+ relinka: RelinkaConfig;
507
622
  }
508
623
  export type BumpMode = "patch" | "minor" | "major" | "auto" | "manual";
509
624
  /**
@@ -693,4 +808,5 @@ export declare const defineConfig: (userConfig?: Partial<DlerConfig>) => {
693
808
  };
694
809
  buildPreExtensions: string[];
695
810
  buildTemplatesDir: string;
811
+ relinka: RelinkaConfig;
696
812
  };
@@ -79,7 +79,82 @@ export const DEFAULT_CONFIG_DLER = {
79
79
  buildPreExtensions: ["ts", "js"],
80
80
  // If you need to exclude some ts/js files from being built,
81
81
  // you can store them in the dirs with buildTemplatesDir name
82
- buildTemplatesDir: "templates"
82
+ buildTemplatesDir: "templates",
83
+ // Integrated relinka logger configuration
84
+ relinka: {
85
+ verbose: false,
86
+ dirs: {
87
+ maxLogFiles: 5
88
+ },
89
+ disableColors: false,
90
+ logFile: {
91
+ outputPath: "logs.log",
92
+ nameWithDate: "disable",
93
+ freshLogFile: true
94
+ },
95
+ saveLogsToFile: true,
96
+ timestamp: {
97
+ enabled: false,
98
+ format: "HH:mm:ss"
99
+ },
100
+ cleanupInterval: 1e4,
101
+ // 10 seconds
102
+ bufferSize: 4096,
103
+ // 4KB
104
+ maxBufferAge: 5e3,
105
+ // 5 seconds
106
+ levels: {
107
+ success: {
108
+ symbol: "\u2713",
109
+ fallbackSymbol: "[OK]",
110
+ color: "greenBright",
111
+ spacing: 3
112
+ },
113
+ info: {
114
+ symbol: "i",
115
+ fallbackSymbol: "[i]",
116
+ color: "cyanBright",
117
+ spacing: 3
118
+ },
119
+ error: {
120
+ symbol: "\u2716",
121
+ fallbackSymbol: "[ERR]",
122
+ color: "redBright",
123
+ spacing: 3
124
+ },
125
+ warn: {
126
+ symbol: "\u26A0",
127
+ fallbackSymbol: "[WARN]",
128
+ color: "yellowBright",
129
+ spacing: 3
130
+ },
131
+ fatal: {
132
+ symbol: "\u203C",
133
+ fallbackSymbol: "[FATAL]",
134
+ color: "redBright",
135
+ spacing: 3
136
+ },
137
+ verbose: {
138
+ symbol: "\u2727",
139
+ fallbackSymbol: "[VERBOSE]",
140
+ color: "gray",
141
+ spacing: 3
142
+ },
143
+ internal: {
144
+ symbol: "\u2699",
145
+ fallbackSymbol: "[INTERNAL]",
146
+ color: "magentaBright",
147
+ spacing: 3
148
+ },
149
+ log: { symbol: "\u2502", fallbackSymbol: "|", color: "dim", spacing: 3 },
150
+ message: {
151
+ symbol: "\u{1F7A0}",
152
+ fallbackSymbol: "[MSG]",
153
+ color: "cyan",
154
+ spacing: 3
155
+ }
156
+ }
157
+ }
83
158
  };
84
159
  export const defineConfig = (userConfig = {}) => {
85
160
  return { ...DEFAULT_CONFIG_DLER, ...userConfig };
@@ -77,7 +77,82 @@ export const DEFAULT_CONFIG_DLER = {
77
77
  buildPreExtensions: ["ts", "js"],
78
78
  // If you need to exclude some ts/js files from being built,
79
79
  // you can store them in the dirs with buildTemplatesDir name
80
- buildTemplatesDir: "templates"
80
+ buildTemplatesDir: "templates",
81
+ // Integrated relinka logger configuration
82
+ relinka: {
83
+ verbose: false,
84
+ dirs: {
85
+ maxLogFiles: 5
86
+ },
87
+ disableColors: false,
88
+ logFile: {
89
+ outputPath: "logs.log",
90
+ nameWithDate: "disable",
91
+ freshLogFile: true
92
+ },
93
+ saveLogsToFile: true,
94
+ timestamp: {
95
+ enabled: false,
96
+ format: "HH:mm:ss"
97
+ },
98
+ cleanupInterval: 1e4,
99
+ // 10 seconds
100
+ bufferSize: 4096,
101
+ // 4KB
102
+ maxBufferAge: 5e3,
103
+ // 5 seconds
104
+ levels: {
105
+ success: {
106
+ symbol: "\u2713",
107
+ fallbackSymbol: "[OK]",
108
+ color: "greenBright",
109
+ spacing: 3
110
+ },
111
+ info: {
112
+ symbol: "i",
113
+ fallbackSymbol: "[i]",
114
+ color: "cyanBright",
115
+ spacing: 3
116
+ },
117
+ error: {
118
+ symbol: "\u2716",
119
+ fallbackSymbol: "[ERR]",
120
+ color: "redBright",
121
+ spacing: 3
122
+ },
123
+ warn: {
124
+ symbol: "\u26A0",
125
+ fallbackSymbol: "[WARN]",
126
+ color: "yellowBright",
127
+ spacing: 3
128
+ },
129
+ fatal: {
130
+ symbol: "\u203C",
131
+ fallbackSymbol: "[FATAL]",
132
+ color: "redBright",
133
+ spacing: 3
134
+ },
135
+ verbose: {
136
+ symbol: "\u2727",
137
+ fallbackSymbol: "[VERBOSE]",
138
+ color: "gray",
139
+ spacing: 3
140
+ },
141
+ internal: {
142
+ symbol: "\u2699",
143
+ fallbackSymbol: "[INTERNAL]",
144
+ color: "magentaBright",
145
+ spacing: 3
146
+ },
147
+ log: { symbol: "\u2502", fallbackSymbol: "|", color: "dim", spacing: 3 },
148
+ message: {
149
+ symbol: "\u{1F7A0}",
150
+ fallbackSymbol: "[MSG]",
151
+ color: "cyan",
152
+ spacing: 3
153
+ }
154
+ }
155
+ }
81
156
  };
82
157
  export const defineConfig = (userConfig = {}) => {
83
158
  return { ...DEFAULT_CONFIG_DLER, ...userConfig };
@@ -1,5 +1,5 @@
1
1
  import { endPrompt, startPrompt } from "@reliverse/rempts";
2
- const version = "1.7.86";
2
+ const version = "1.7.87";
3
3
  export async function showStartPrompt(isDev) {
4
4
  await startPrompt({
5
5
  titleColor: "inverse",
@@ -1,3 +1,111 @@
1
+ /** Configuration for directory-related settings. */
2
+ export interface RelinkaDirsConfig {
3
+ maxLogFiles?: number;
4
+ }
5
+ /** Log level types used by the logger. */
6
+ export type LogLevel = "error" | "fatal" | "info" | "success" | "verbose" | "warn" | "log" | "internal" | "null" | "step" | "box" | "message";
7
+ /** Configuration for a single log level. */
8
+ export interface LogLevelConfig {
9
+ /**
10
+ * Symbol to display for this log level.
11
+ * @see https://symbl.cc
12
+ */
13
+ symbol: string;
14
+ /**
15
+ * Fallback symbol to use if Unicode is not supported.
16
+ */
17
+ fallbackSymbol: string;
18
+ /**
19
+ * Color to use for this log level.
20
+ */
21
+ color: string;
22
+ /**
23
+ * Number of spaces after the symbol/fallback
24
+ */
25
+ spacing?: number;
26
+ }
27
+ /** Configuration for all log levels. */
28
+ export type LogLevelsConfig = Partial<Record<LogLevel, LogLevelConfig>>;
29
+ /**
30
+ * Configuration options for the Relinka logger.
31
+ * All properties are optional to allow for partial configuration.
32
+ * Defaults will be applied during initialization.
33
+ */
34
+ export interface RelinkaConfig {
35
+ /**
36
+ * Enables verbose (aka debug) mode for detailed logging.
37
+ *
38
+ * `true` here works only for end-users of CLIs/libs when theirs developers
39
+ * has been awaited for user's config via `@reliverse/relinka`'s `await relinkaConfig;`
40
+ */
41
+ verbose?: boolean;
42
+ /**
43
+ * Configuration for directory-related settings.
44
+ * - `maxLogFiles`: The maximum number of log files to keep before cleanup.
45
+ */
46
+ dirs?: RelinkaDirsConfig;
47
+ /**
48
+ * Disables color output in the console.
49
+ */
50
+ disableColors?: boolean;
51
+ /**
52
+ * Configuration for log file output.
53
+ */
54
+ logFile?: {
55
+ /**
56
+ * Path to the log file.
57
+ */
58
+ outputPath?: string;
59
+ /**
60
+ * How to handle date in the filename.
61
+ * - `disable`: No date prefix/suffix
62
+ * - `append-before`: Add date before the filename (e.g., "2024-01-15-log.txt")
63
+ * - `append-after`: Add date after the filename (e.g., "log-2024-01-15.txt")
64
+ */
65
+ nameWithDate?: "disable" | "append-before" | "append-after";
66
+ /**
67
+ * If true, clears the log file when relinkaConfig is executed with supportFreshLogFile: true.
68
+ * This is useful for starting with a clean log file on each run.
69
+ */
70
+ freshLogFile?: boolean;
71
+ };
72
+ /**
73
+ * If true, logs will be saved to a file.
74
+ */
75
+ saveLogsToFile?: boolean;
76
+ /**
77
+ * Configuration for timestamp in log messages.
78
+ */
79
+ timestamp?: {
80
+ /**
81
+ * If true, timestamps will be added to log messages.
82
+ */
83
+ enabled: boolean;
84
+ /**
85
+ * The format for timestamps. Default is YYYY-MM-DD HH:mm:ss.SSS
86
+ */
87
+ format?: string;
88
+ };
89
+ /**
90
+ * Allows to customize the log levels.
91
+ */
92
+ levels?: LogLevelsConfig;
93
+ /**
94
+ * Controls how often the log cleanup runs (in milliseconds)
95
+ * Default: 10000 (10 seconds)
96
+ */
97
+ cleanupInterval?: number;
98
+ /**
99
+ * Maximum size of the log write buffer before flushing to disk (in bytes)
100
+ * Default: 4096 (4KB)
101
+ */
102
+ bufferSize?: number;
103
+ /**
104
+ * Maximum time to hold logs in buffer before flushing to disk (in milliseconds)
105
+ * Default: 5000 (5 seconds)
106
+ */
107
+ maxBufferAge?: number;
108
+ }
1
109
  /**
2
110
  * Defines the configuration for building and publishing packages. This includes: versioning,
3
111
  * build settings, publishing options, libraries-dler-plugin built-in plugin, and more.
@@ -504,6 +612,13 @@ export interface DlerConfig {
504
612
  * @default "templates"
505
613
  */
506
614
  buildTemplatesDir: string;
615
+ /**
616
+ * Integrated relinka logger configuration.
617
+ * @see https://github.com/reliverse/relinka
618
+ *
619
+ * @default See DEFAULT_RELINKA_CONFIG in defaults
620
+ */
621
+ relinka: RelinkaConfig;
507
622
  }
508
623
  export type BumpMode = "patch" | "minor" | "major" | "auto" | "manual";
509
624
  /**
@@ -42,7 +42,7 @@ export { DEFAULT_CONFIG_DLER, defineConfig } from "./sdk-impl/config/default.js"
42
42
  export { showStartPrompt, showEndPrompt } from "./sdk-impl/config/info.js";
43
43
  export { getConfigDler, getConfigBunfig } from "./sdk-impl/config/load.js";
44
44
  export { ensureDlerConfig, prepareDlerEnvironment } from "./sdk-impl/config/prepare.js";
45
- export type { DlerConfig, BumpMode, BundlerName, NpmOutExt, LibConfig, Esbuild, transpileFormat, Sourcemap, transpileTarget, } from "./sdk-impl/config/types.js";
45
+ export type { DlerConfig, BumpMode, BundlerName, NpmOutExt, LibConfig, Esbuild, transpileFormat, Sourcemap, transpileTarget, RelinkaConfig, LogLevel, LogLevelConfig, LogLevelsConfig, RelinkaDirsConfig, } from "./sdk-impl/config/types.js";
46
46
  export { IGNORE_PATTERNS } from "./sdk-impl/constants.js";
47
47
  export { library_buildFlow, library_pubFlow, libraries_build, libraries_publish, } from "./sdk-impl/library-flow.js";
48
48
  export type { ApplyMagicSpellsOptions, ApplyMagicSpellsResult, FileWithSpells, } from "./sdk-impl/magic/magic-apply.js";
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "@reliverse/reglob": "^1.0.0",
6
6
  "@reliverse/relico": "^1.2.0",
7
7
  "@reliverse/relifso": "^1.4.5",
8
- "@reliverse/relinka": "^1.5.3",
8
+ "@reliverse/relinka": "^1.5.4",
9
9
  "@reliverse/rempts": "^1.7.44",
10
10
  "@rollup/plugin-alias": "^5.1.1",
11
11
  "@rollup/plugin-commonjs": "^28.0.6",
@@ -52,7 +52,7 @@
52
52
  "license": "MIT",
53
53
  "name": "@reliverse/dler",
54
54
  "type": "module",
55
- "version": "1.7.86",
55
+ "version": "1.7.87",
56
56
  "keywords": [
57
57
  "reliverse",
58
58
  "cli",