colorino 0.11.0 → 0.12.0

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
@@ -38,7 +38,7 @@ Colorino is different: it’s a "batteries-included" logging facade with beautif
38
38
 
39
39
  ## <a id="2"></a>Features
40
40
 
41
- - 🎨 **Smart Theming:** Automatically detects *dark/light* mode and applies a **minimal** high-contrast base palette by default; opt into a coordinated theme preset when you want richer colors.
41
+ - 🎨 **Smart Theming:** Automatically detects *dark/light* mode and applies a highcontrast base palette by default (Dracula for dark, GitHub Light for light); opt into a coordinated theme preset when you want richer colors.
42
42
  - 🤘 **Graceful Color Degradation**: Accepts rich colors (hex/RGB) and automatically down‑samples to the best ANSI‑16/ANSI‑256/Truecolor match for the current environment.​
43
43
  - 🤝 **Familiar API:** If you know `console.log`, you already know Colorino: all standard log levels are supported.
44
44
  - 🔀 **Environment-Aware:** Works in **Node.js** (ANSI color and truecolor) and all major **Browsers** (CSS styles).
@@ -150,17 +150,17 @@ Pass any of these names to the `theme` option to use a specific palette:
150
150
 
151
151
  | Theme Name | Type | Description |
152
152
  |----------------------|-----------------|--------------------------------------------------|
153
- | `'dracula'` | **Dark** (High) | Vibrant pinks, purples, and cyans. |
154
- | `'catppuccin-mocha'` | **Dark** (Low) | Soothing pastel colors. |
155
- | `'minimal-dark'` | **Dark** | *Default Dark (auto).* Minimal, high-contrast. |
156
- | `'minimal-light'` | **Light** | *Default Light (auto).* Minimal, high-contrast. |
157
- | `'github-light'` | **Light** (High)| Clean, sharp, high-contrast. |
158
- | `'catppuccin-latte'` | **Light** (Low) | Warm, cozy light mode with soft colors. |
153
+ | `'dracula'` | **Dark** (High Contrast) | Vibrant pinks, purples, and cyans. |
154
+ | `'catppuccin-mocha'` | **Dark** (Low Contrast) | Soothing pastel colors. |
155
+ | `'github-light'` | **Light** (High Contrast)| Clean, sharp, high-contrast. |
156
+ | `'catppuccin-latte'` | **Light** (Low Contrast) | Warm, cozy light mode with soft colors. |
157
+
158
+ In auto mode, Colorino uses dracula in dark environments and github-light in light environments.
159
159
 
160
160
  #### <a id="5-3-2"></a>Examples
161
161
 
162
- **1. Minimal defaults with custom branding:**
163
- Set only the colors you care about; everything else stays maximally readable.
162
+ **1. Default palette with custom branding:**
163
+ Set only the colors you care about; everything else uses the detected base theme or your explicitly selected theme.
164
164
 
165
165
  ```typescript
166
166
  // Only customize error and warn
@@ -169,15 +169,21 @@ const myLogger = createColorino({
169
169
  warn: '#ffa500'
170
170
  })
171
171
 
172
- // Detected dark terminal:
172
+ // Detected dark terminal (uses dracula as base):
173
173
  // - error: #ff007b (your custom red)
174
174
  // - warn: #ffa500 (your custom orange)
175
- // - info, log, debug, trace: #ffffff (white - safe on dark)
175
+ // - info: #8be9fd (dracula cyan)
176
+ // - log: #f8f8f2 (dracula foreground)
177
+ // - debug: #bd93f9 (dracula purple)
178
+ // - trace: #6272a4 (dracula comment)
176
179
 
177
- // Detected light terminal:
180
+ // Detected light terminal (uses github-light as base):
178
181
  // - error: #ff007b (your custom red)
179
182
  // - warn: #ffa500 (your custom orange)
180
- // - info, log, debug, trace: #000000 (black - safe on light)
183
+ // - info: #0366d6 (github blue)
184
+ // - log: #24292e (github text)
185
+ // - debug: #586069 (github gray)
186
+ // - trace: #6a737d (github gray-light)
181
187
  ```
182
188
 
183
189
  **2. Use a specific preset:**
@@ -200,10 +206,10 @@ const myLogger = createColorino(
200
206
  ```
201
207
 
202
208
  **4. Force a specific mode (uses defaults):**
203
- Useful for CI/CD or environments where detection fails.
209
+ Useful for environments where detection fails.
204
210
 
205
211
  ```typescript
206
- // Forces dark mode using the default minimal palette (minimal-dark)
212
+ // Forces dark mode using the default palette
207
213
  const darkLogger = createColorino({}, { theme: 'dark' })
208
214
  ```
209
215
 
@@ -119,33 +119,15 @@ const githubLightPalette = {
119
119
  trace: "#6a737d"
120
120
  // Gray-light
121
121
  };
122
- const minimalDarkPalette = {
123
- log: "#ffffff",
124
- info: "#ffffff",
125
- warn: "#ffffff",
126
- error: "#ffffff",
127
- debug: "#ffffff",
128
- trace: "#ffffff"
129
- };
130
- const minimalLightPalette = {
131
- log: "#000000",
132
- info: "#000000",
133
- warn: "#000000",
134
- error: "#000000",
135
- debug: "#000000",
136
- trace: "#000000"
137
- };
138
122
 
139
123
  const themePalettes = {
140
124
  "catppuccin-mocha": catppuccinMochaPalette,
141
125
  "catppuccin-latte": catppuccinLattePalette,
142
126
  dracula: draculaPalette,
143
- "github-light": githubLightPalette,
144
- "minimal-dark": minimalDarkPalette,
145
- "minimal-light": minimalLightPalette
127
+ "github-light": githubLightPalette
146
128
  };
147
- const defaultDarkTheme = "minimal-dark";
148
- const defaultLightTheme = "minimal-light";
129
+ const defaultDarkTheme = "dracula";
130
+ const defaultLightTheme = "github-light";
149
131
  function isThemeName(theme) {
150
132
  return theme in themePalettes;
151
133
  }
@@ -117,33 +117,15 @@ const githubLightPalette = {
117
117
  trace: "#6a737d"
118
118
  // Gray-light
119
119
  };
120
- const minimalDarkPalette = {
121
- log: "#ffffff",
122
- info: "#ffffff",
123
- warn: "#ffffff",
124
- error: "#ffffff",
125
- debug: "#ffffff",
126
- trace: "#ffffff"
127
- };
128
- const minimalLightPalette = {
129
- log: "#000000",
130
- info: "#000000",
131
- warn: "#000000",
132
- error: "#000000",
133
- debug: "#000000",
134
- trace: "#000000"
135
- };
136
120
 
137
121
  const themePalettes = {
138
122
  "catppuccin-mocha": catppuccinMochaPalette,
139
123
  "catppuccin-latte": catppuccinLattePalette,
140
124
  dracula: draculaPalette,
141
- "github-light": githubLightPalette,
142
- "minimal-dark": minimalDarkPalette,
143
- "minimal-light": minimalLightPalette
125
+ "github-light": githubLightPalette
144
126
  };
145
- const defaultDarkTheme = "minimal-dark";
146
- const defaultLightTheme = "minimal-light";
127
+ const defaultDarkTheme = "dracula";
128
+ const defaultLightTheme = "github-light";
147
129
  function isThemeName(theme) {
148
130
  return theme in themePalettes;
149
131
  }
package/dist/browser.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const inputValidator = require('./shared/colorino.D9xuyiJg.cjs');
3
+ const inputValidator = require('./shared/colorino.BgxwS1Lc.cjs');
4
4
 
5
5
  class BrowserColorSupportDetector {
6
6
  constructor(_window, _navigator, _overrideTheme) {
@@ -1,5 +1,5 @@
1
- import { T as ThemeName, P as Palette, C as ColorinoOptions, a as Colorino } from './shared/colorino.bX_hrCT6.cjs';
2
- export { L as LogLevel } from './shared/colorino.bX_hrCT6.cjs';
1
+ import { T as ThemeName, P as Palette, C as ColorinoOptions, a as Colorino } from './shared/colorino.Dh_05jaQ.cjs';
2
+ export { L as LogLevel } from './shared/colorino.Dh_05jaQ.cjs';
3
3
 
4
4
  declare const themePalettes: Record<ThemeName, Palette>;
5
5
 
@@ -1,5 +1,5 @@
1
- import { T as ThemeName, P as Palette, C as ColorinoOptions, a as Colorino } from './shared/colorino.bX_hrCT6.mjs';
2
- export { L as LogLevel } from './shared/colorino.bX_hrCT6.mjs';
1
+ import { T as ThemeName, P as Palette, C as ColorinoOptions, a as Colorino } from './shared/colorino.Dh_05jaQ.mjs';
2
+ export { L as LogLevel } from './shared/colorino.Dh_05jaQ.mjs';
3
3
 
4
4
  declare const themePalettes: Record<ThemeName, Palette>;
5
5
 
package/dist/browser.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { T as ThemeName, P as Palette, C as ColorinoOptions, a as Colorino } from './shared/colorino.bX_hrCT6.js';
2
- export { L as LogLevel } from './shared/colorino.bX_hrCT6.js';
1
+ import { T as ThemeName, P as Palette, C as ColorinoOptions, a as Colorino } from './shared/colorino.Dh_05jaQ.js';
2
+ export { L as LogLevel } from './shared/colorino.Dh_05jaQ.js';
3
3
 
4
4
  declare const themePalettes: Record<ThemeName, Palette>;
5
5
 
package/dist/browser.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { C as ColorLevel, t as themePalettes, M as MyColorino, I as InputValidator, d as determineBaseTheme } from './shared/colorino.BPD_4Zhq.mjs';
1
+ import { C as ColorLevel, t as themePalettes, M as MyColorino, I as InputValidator, d as determineBaseTheme } from './shared/colorino.ClDpLv-k.mjs';
2
2
 
3
3
  class BrowserColorSupportDetector {
4
4
  constructor(_window, _navigator, _overrideTheme) {
package/dist/node.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const inputValidator = require('./shared/colorino.D9xuyiJg.cjs');
3
+ const inputValidator = require('./shared/colorino.BgxwS1Lc.cjs');
4
4
  const node_child_process = require('node:child_process');
5
5
  const node_url = require('node:url');
6
6
  const node_path = require('node:path');
package/dist/node.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { P as Palette, C as ColorinoOptions, a as Colorino } from './shared/colorino.bX_hrCT6.cjs';
1
+ import { P as Palette, C as ColorinoOptions, a as Colorino } from './shared/colorino.Dh_05jaQ.cjs';
2
2
 
3
3
  declare function createColorino(userPalette?: Partial<Palette>, options?: ColorinoOptions): Colorino;
4
4
 
package/dist/node.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { P as Palette, C as ColorinoOptions, a as Colorino } from './shared/colorino.bX_hrCT6.mjs';
1
+ import { P as Palette, C as ColorinoOptions, a as Colorino } from './shared/colorino.Dh_05jaQ.mjs';
2
2
 
3
3
  declare function createColorino(userPalette?: Partial<Palette>, options?: ColorinoOptions): Colorino;
4
4
 
package/dist/node.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { P as Palette, C as ColorinoOptions, a as Colorino } from './shared/colorino.bX_hrCT6.js';
1
+ import { P as Palette, C as ColorinoOptions, a as Colorino } from './shared/colorino.Dh_05jaQ.js';
2
2
 
3
3
  declare function createColorino(userPalette?: Partial<Palette>, options?: ColorinoOptions): Colorino;
4
4
 
package/dist/node.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { C as ColorLevel, t as themePalettes, M as MyColorino, I as InputValidator, d as determineBaseTheme } from './shared/colorino.BPD_4Zhq.mjs';
1
+ import { C as ColorLevel, t as themePalettes, M as MyColorino, I as InputValidator, d as determineBaseTheme } from './shared/colorino.ClDpLv-k.mjs';
2
2
  import { spawnSync } from 'node:child_process';
3
3
  import { fileURLToPath } from 'node:url';
4
4
  import { dirname, join } from 'node:path';
@@ -119,33 +119,15 @@ const githubLightPalette = {
119
119
  trace: "#6a737d"
120
120
  // Gray-light
121
121
  };
122
- const minimalDarkPalette = {
123
- log: "#ffffff",
124
- info: "#ffffff",
125
- warn: "#ffffff",
126
- error: "#ffffff",
127
- debug: "#ffffff",
128
- trace: "#ffffff"
129
- };
130
- const minimalLightPalette = {
131
- log: "#000000",
132
- info: "#000000",
133
- warn: "#000000",
134
- error: "#000000",
135
- debug: "#000000",
136
- trace: "#000000"
137
- };
138
122
 
139
123
  const themePalettes = {
140
124
  "catppuccin-mocha": catppuccinMochaPalette,
141
125
  "catppuccin-latte": catppuccinLattePalette,
142
126
  dracula: draculaPalette,
143
- "github-light": githubLightPalette,
144
- "minimal-dark": minimalDarkPalette,
145
- "minimal-light": minimalLightPalette
127
+ "github-light": githubLightPalette
146
128
  };
147
- const defaultDarkTheme = "minimal-dark";
148
- const defaultLightTheme = "minimal-light";
129
+ const defaultDarkTheme = "dracula";
130
+ const defaultLightTheme = "github-light";
149
131
  function isThemeName(theme) {
150
132
  return theme in themePalettes;
151
133
  }
@@ -117,33 +117,15 @@ const githubLightPalette = {
117
117
  trace: "#6a737d"
118
118
  // Gray-light
119
119
  };
120
- const minimalDarkPalette = {
121
- log: "#ffffff",
122
- info: "#ffffff",
123
- warn: "#ffffff",
124
- error: "#ffffff",
125
- debug: "#ffffff",
126
- trace: "#ffffff"
127
- };
128
- const minimalLightPalette = {
129
- log: "#000000",
130
- info: "#000000",
131
- warn: "#000000",
132
- error: "#000000",
133
- debug: "#000000",
134
- trace: "#000000"
135
- };
136
120
 
137
121
  const themePalettes = {
138
122
  "catppuccin-mocha": catppuccinMochaPalette,
139
123
  "catppuccin-latte": catppuccinLattePalette,
140
124
  dracula: draculaPalette,
141
- "github-light": githubLightPalette,
142
- "minimal-dark": minimalDarkPalette,
143
- "minimal-light": minimalLightPalette
125
+ "github-light": githubLightPalette
144
126
  };
145
- const defaultDarkTheme = "minimal-dark";
146
- const defaultLightTheme = "minimal-light";
127
+ const defaultDarkTheme = "dracula";
128
+ const defaultLightTheme = "github-light";
147
129
  function isThemeName(theme) {
148
130
  return theme in themePalettes;
149
131
  }
@@ -2,7 +2,7 @@ type ConsoleMethod = 'log' | 'info' | 'warn' | 'error' | 'trace' | 'debug';
2
2
  type LogLevel = ConsoleMethod & string;
3
3
  type Palette = Record<LogLevel, string>;
4
4
  type TerminalTheme = 'dark' | 'light' | 'unknown';
5
- type ThemeName = 'catppuccin-mocha' | 'catppuccin-latte' | 'dracula' | 'github-light' | 'minimal-dark' | 'minimal-light';
5
+ type ThemeName = 'catppuccin-mocha' | 'catppuccin-latte' | 'dracula' | 'github-light';
6
6
  interface ColorinoOptions {
7
7
  disableWarnings?: boolean;
8
8
  theme?: TerminalTheme | ThemeName | 'auto';
@@ -2,7 +2,7 @@ type ConsoleMethod = 'log' | 'info' | 'warn' | 'error' | 'trace' | 'debug';
2
2
  type LogLevel = ConsoleMethod & string;
3
3
  type Palette = Record<LogLevel, string>;
4
4
  type TerminalTheme = 'dark' | 'light' | 'unknown';
5
- type ThemeName = 'catppuccin-mocha' | 'catppuccin-latte' | 'dracula' | 'github-light' | 'minimal-dark' | 'minimal-light';
5
+ type ThemeName = 'catppuccin-mocha' | 'catppuccin-latte' | 'dracula' | 'github-light';
6
6
  interface ColorinoOptions {
7
7
  disableWarnings?: boolean;
8
8
  theme?: TerminalTheme | ThemeName | 'auto';
@@ -2,7 +2,7 @@ type ConsoleMethod = 'log' | 'info' | 'warn' | 'error' | 'trace' | 'debug';
2
2
  type LogLevel = ConsoleMethod & string;
3
3
  type Palette = Record<LogLevel, string>;
4
4
  type TerminalTheme = 'dark' | 'light' | 'unknown';
5
- type ThemeName = 'catppuccin-mocha' | 'catppuccin-latte' | 'dracula' | 'github-light' | 'minimal-dark' | 'minimal-light';
5
+ type ThemeName = 'catppuccin-mocha' | 'catppuccin-latte' | 'dracula' | 'github-light';
6
6
  interface ColorinoOptions {
7
7
  disableWarnings?: boolean;
8
8
  theme?: TerminalTheme | ThemeName | 'auto';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "colorino",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "A super simple colorized logger that gets the most out of your terminal",
5
5
  "type": "module",
6
6
  "license": "MIT",