@visulima/is-ansi-color-supported 2.2.8 → 2.2.9
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/CHANGELOG.md +19 -0
- package/LICENSE.md +6 -0
- package/README.md +10 -10
- package/dist/is-color-supported.browser.mjs +1 -1
- package/dist/is-color-supported.edge-light.d.mts +11 -0
- package/dist/is-color-supported.edge-light.d.ts +11 -0
- package/dist/is-color-supported.edge-light.mjs +1 -0
- package/dist/is-color-supported.server.mjs +1 -1
- package/package.json +20 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
## @visulima/is-ansi-color-supported [2.2.9](https://github.com/visulima/visulima/compare/@visulima/is-ansi-color-supported@2.2.8...@visulima/is-ansi-color-supported@2.2.9) (2024-12-12)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* added missing placeholder variables into LICENSE.md file ([cef32c6](https://github.com/visulima/visulima/commit/cef32c6eb19dc3215a835e848ef12223a8fa05e0))
|
|
6
|
+
* allow node v23 ([8ca929a](https://github.com/visulima/visulima/commit/8ca929af311ce8036cbbfde68b6db05381b860a5))
|
|
7
|
+
* allowed node 23, updated dev dependencies ([f99d34e](https://github.com/visulima/visulima/commit/f99d34e01f6b13be8586a1b5d37dc8b8df0a5817))
|
|
8
|
+
* create a new edge-light export to remove the process check in browser export and updated packem to v1.9.2 ([c3b73c6](https://github.com/visulima/visulima/commit/c3b73c6ed25654e2b855f6bf23cf6508dc08d057))
|
|
9
|
+
* updated packem to v1.8.2 ([23f869b](https://github.com/visulima/visulima/commit/23f869b4120856cc97e2bffa6d508e2ae30420ea))
|
|
10
|
+
|
|
11
|
+
### Styles
|
|
12
|
+
|
|
13
|
+
* cs fixes ([46d31e0](https://github.com/visulima/visulima/commit/46d31e082e1865262bf380859c14fabd28ff456d))
|
|
14
|
+
* **is-ansi-color-supported:** fixed order of exports ([2e89785](https://github.com/visulima/visulima/commit/2e89785846f812f50c239161aed9428df4320215))
|
|
15
|
+
|
|
16
|
+
### Miscellaneous Chores
|
|
17
|
+
|
|
18
|
+
* updated dev dependencies ([a916944](https://github.com/visulima/visulima/commit/a916944b888bb34c34b0c54328b38d29e4399857))
|
|
19
|
+
|
|
1
20
|
## @visulima/is-ansi-color-supported [2.2.8](https://github.com/visulima/visulima/compare/@visulima/is-ansi-color-supported@2.2.7...@visulima/is-ansi-color-supported@2.2.8) (2024-10-05)
|
|
2
21
|
|
|
3
22
|
### Bug Fixes
|
package/LICENSE.md
CHANGED
|
@@ -19,3 +19,9 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
<!-- DEPENDENCIES -->
|
|
24
|
+
<!-- /DEPENDENCIES -->
|
|
25
|
+
|
|
26
|
+
<!-- TYPE_DEPENDENCIES -->
|
|
27
|
+
<!-- /TYPE_DEPENDENCIES -->
|
package/README.md
CHANGED
|
@@ -60,10 +60,10 @@ console.log(isStderrColorSupported()); // 3
|
|
|
60
60
|
|
|
61
61
|
Ansis automatically detects the supported color space:
|
|
62
62
|
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
63
|
+
- TrueColor
|
|
64
|
+
- ANSI 256 colors
|
|
65
|
+
- ANSI 16 colors
|
|
66
|
+
- black & white (no color)
|
|
67
67
|
|
|
68
68
|
There is no standard way to detect which color space is supported.
|
|
69
69
|
The most common way to detect color support is to check the `TERM` and `COLORTERM` environment variables.
|
|
@@ -93,8 +93,8 @@ Combine that with the knowledge about which operating system the program is runn
|
|
|
93
93
|
|
|
94
94
|
See also:
|
|
95
95
|
|
|
96
|
-
-
|
|
97
|
-
-
|
|
96
|
+
- [Truecolor Support in Output Devices](https://github.com/termstandard/colors#truecolor-support-in-output-devices).
|
|
97
|
+
- [So you want to render colors in your terminal](https://marvinh.dev/blog/terminal-colors/).
|
|
98
98
|
|
|
99
99
|
## Environment variables
|
|
100
100
|
|
|
@@ -145,8 +145,8 @@ Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=
|
|
|
145
145
|
|
|
146
146
|
## Related
|
|
147
147
|
|
|
148
|
-
-
|
|
149
|
-
-
|
|
148
|
+
- [supports-color](https://github.com/chalk/supports-color) - Detect whether a terminal supports color
|
|
149
|
+
- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module
|
|
150
150
|
|
|
151
151
|
## Supported Node.js Versions
|
|
152
152
|
|
|
@@ -161,8 +161,8 @@ If you would like to help take a look at the [list of issues](https://github.com
|
|
|
161
161
|
|
|
162
162
|
## Credits
|
|
163
163
|
|
|
164
|
-
-
|
|
165
|
-
-
|
|
164
|
+
- [Daniel Bannert](https://github.com/prisis)
|
|
165
|
+
- [All Contributors](https://github.com/visulima/visulima/graphs/contributors)
|
|
166
166
|
|
|
167
167
|
## License
|
|
168
168
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var a=Object.defineProperty;var o=(r,t)=>a(r,"name",{value:t,configurable:!0});import{SPACE_TRUE_COLORS as n,SPACE_16_COLORS as i,SPACE_MONO as u}from"./packem_shared/SPACE_MONO-BEQbKWNs.mjs";import{SPACE_256_COLORS as g}from"./packem_shared/SPACE_MONO-BEQbKWNs.mjs";var C=Object.defineProperty,p=o((r,t)=>C(r,"name",{value:t,configurable:!0}),"t");const e=p(()=>(()=>{if(typeof navigator<"u"){if(navigator.userAgentData&&navigator.userAgentData.brands.find(({b:r})=>r==="Chromium")?.version>93)return n;if(/\b(Chrome|Chromium)\//.test(navigator.userAgent))return i}return u})(),"isColorSupported"),f=e,m=e;export{i as SPACE_16_COLORS,g as SPACE_256_COLORS,u as SPACE_MONO,n as SPACE_TRUE_COLORS,m as isStderrColorSupported,f as isStdoutColorSupported};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type ColorSupportLevel = 0 | 1 | 2 | 3;
|
|
2
|
+
|
|
3
|
+
declare const SPACE_MONO = 0;
|
|
4
|
+
declare const SPACE_16_COLORS = 1;
|
|
5
|
+
declare const SPACE_256_COLORS = 2;
|
|
6
|
+
declare const SPACE_TRUE_COLORS = 3;
|
|
7
|
+
|
|
8
|
+
declare const isStdoutColorSupported: () => ColorSupportLevel;
|
|
9
|
+
declare const isStderrColorSupported: () => ColorSupportLevel;
|
|
10
|
+
|
|
11
|
+
export { type ColorSupportLevel, SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO, SPACE_TRUE_COLORS, isStderrColorSupported, isStdoutColorSupported };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type ColorSupportLevel = 0 | 1 | 2 | 3;
|
|
2
|
+
|
|
3
|
+
declare const SPACE_MONO = 0;
|
|
4
|
+
declare const SPACE_16_COLORS = 1;
|
|
5
|
+
declare const SPACE_256_COLORS = 2;
|
|
6
|
+
declare const SPACE_TRUE_COLORS = 3;
|
|
7
|
+
|
|
8
|
+
declare const isStdoutColorSupported: () => ColorSupportLevel;
|
|
9
|
+
declare const isStderrColorSupported: () => ColorSupportLevel;
|
|
10
|
+
|
|
11
|
+
export { type ColorSupportLevel, SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO, SPACE_TRUE_COLORS, isStderrColorSupported, isStdoutColorSupported };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a=Object.defineProperty;var o=(r,e)=>a(r,"name",{value:e,configurable:!0});import{SPACE_TRUE_COLORS as i,SPACE_16_COLORS as t,SPACE_MONO as u}from"./packem_shared/SPACE_MONO-BEQbKWNs.mjs";import{SPACE_256_COLORS as E}from"./packem_shared/SPACE_MONO-BEQbKWNs.mjs";var s=Object.defineProperty,p=o((r,e)=>s(r,"name",{value:e,configurable:!0}),"t$1");const d=p(()=>(()=>{if(typeof navigator<"u"){if(navigator.userAgentData&&navigator.userAgentData.brands.find(({b:r})=>r==="Chromium")?.version>93)return i;if(/\b(Chrome|Chromium)\//.test(navigator.userAgent))return t}return u})(),"isColorSupported"),C=d;var S=Object.defineProperty,v=o((r,e)=>S(r,"name",{value:e,configurable:!0}),"o");const n=v(()=>process?.env?.NEXT_RUNTIME!==void 0&&process?.env.NEXT_RUNTIME.includes("edge")?t:C(),"isColorSupported"),g=n,l=n;export{t as SPACE_16_COLORS,E as SPACE_256_COLORS,u as SPACE_MONO,i as SPACE_TRUE_COLORS,l as isStderrColorSupported,g as isStdoutColorSupported};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var N=Object.defineProperty;var S=(i,e)=>N(i,"name",{value:e,configurable:!0});import{
|
|
1
|
+
var N=Object.defineProperty;var S=(i,e)=>N(i,"name",{value:e,configurable:!0});import{SPACE_MONO as E,SPACE_256_COLORS as R,SPACE_TRUE_COLORS as u,SPACE_16_COLORS as n}from"./packem_shared/SPACE_MONO-BEQbKWNs.mjs";var L=Object.defineProperty,d=S((i,e)=>L(i,"name",{value:e,configurable:!0}),"f");const m=d(i=>{const e=globalThis,O=e.Deno!=null,l=e.process??e.Deno??{},C=l.argv??l.args??[],T=d(o=>{const p=C.indexOf("--"),I=C.findIndex(A=>o.test(A));return I!==-1&&(p===-1||I<p)},"oneOfFlags");let r={};try{r=O?l.env.toObject():l.env??{}}catch{}const a="FORCE_COLOR",M=a in r,s=r[a]?String(r[a]):void 0,_=Object.prototype.toString.call(s).slice(8,-1)==="String";let t;if(s==="true"?t=n:s==="false"?t=E:_&&s.length===0?t=n:_&&s.length>0&&(t=Math.min(Number.parseInt(s,10),3)),s!=="true"&&s!=="false"&&t!==void 0&&t<4)return t;if("NO_COLOR"in r||M&&t===0||T(/^-{1,2}(no-color|no-colors|color=false|color=never)$/))return E;if(T(/^-{1,2}(color=256)$/))return R;if(T(/^-{1,2}(color=16m|color=full|color=truecolor)$/))return u;if(T(/^-{1,2}(color|colors|color=true|color=always)$/))return n;const f=t||E;if("TF_BUILD"in r&&"AGENT_NAME"in r)return n;if(r.TERM&&/-mono|dumb/i.test(r.TERM))return f;if((O?e.Deno.build.os:l.platform)==="win32")try{const o=(O?e.Deno.osRelease():l.os.release()).split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?u:R:n}catch{}if("CI"in r)return"GITHUB_ACTIONS"in r||"GITHUB_WORKFLOW"in r||"GITEA_ACTIONS"in r?u:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE","GITLAB_CI"].some(o=>o in r)||r.CI_NAME==="codeship"?n:f;if(r.TERMINAL_EMULATOR?.includes("JediTerm"))return u;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?n:E;if(r.COLORTERM==="truecolor")return u;if(r.TERM==="xterm-kitty")return u;if("TERM_PROGRAM"in r){const o=Number.parseInt((r.TERM_PROGRAM_VERSION??"").split(".")[0],10);if(r.TERM_PROGRAM==="iTerm.app")return o>=3?u:R;if(r.TERM_PROGRAM==="Apple_Terminal")return R}if(/-256(color)?$/i.test(r.TERM))return R;let c=!1;return O?i==="out"?c=e.Deno.stdout.isTerminal():i==="err"&&(c=e.Deno.stderr.isTerminal()):"PM2_HOME"in r&&"pm_id"in r?c=!0:c=l["std"+i]&&"isTTY"in l["std"+i],c&&/^screen|^tmux|^xterm|^vt[1-5]\d\d|^ansi|color|mintty|rxvt|cygwin|linux/i.test(r.TERM)?n:"COLORTERM"in r?n:f},"isColorSupportedFactory"),g=d(()=>m("out"),"isStdoutColorSupported"),v=d(()=>m("err"),"isStderrColorSupported");export{n as SPACE_16_COLORS,R as SPACE_256_COLORS,E as SPACE_MONO,u as SPACE_TRUE_COLORS,v as isStderrColorSupported,g as isStdoutColorSupported};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/is-ansi-color-supported",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.9",
|
|
4
4
|
"description": "Detect whether a terminal or browser supports ansi colors.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -60,7 +60,14 @@
|
|
|
60
60
|
"type": "module",
|
|
61
61
|
"exports": {
|
|
62
62
|
".": {
|
|
63
|
-
"
|
|
63
|
+
"edge-light": {
|
|
64
|
+
"types": "./dist/is-color-supported.edge-light.d.mts",
|
|
65
|
+
"default": "./dist/is-color-supported.edge-light.mjs"
|
|
66
|
+
},
|
|
67
|
+
"browser": {
|
|
68
|
+
"types": "./dist/is-color-supported.browser.d.mts",
|
|
69
|
+
"default": "./dist/is-color-supported.browser.mjs"
|
|
70
|
+
},
|
|
64
71
|
"require": {
|
|
65
72
|
"types": "./dist/is-color-supported.server.d.cts",
|
|
66
73
|
"default": "./dist/is-color-supported.server.cjs"
|
|
@@ -92,16 +99,16 @@
|
|
|
92
99
|
"devDependencies": {
|
|
93
100
|
"@anolilab/eslint-config": "^15.0.3",
|
|
94
101
|
"@anolilab/prettier-config": "^5.0.14",
|
|
95
|
-
"@anolilab/semantic-release-pnpm": "^1.1.
|
|
96
|
-
"@anolilab/semantic-release-preset": "^9.0.
|
|
97
|
-
"@arethetypeswrong/cli": "^0.
|
|
98
|
-
"@babel/core": "^7.
|
|
102
|
+
"@anolilab/semantic-release-pnpm": "^1.1.5",
|
|
103
|
+
"@anolilab/semantic-release-preset": "^9.0.2",
|
|
104
|
+
"@arethetypeswrong/cli": "^0.17.1",
|
|
105
|
+
"@babel/core": "^7.26.0",
|
|
99
106
|
"@rushstack/eslint-plugin-security": "^0.8.3",
|
|
100
|
-
"@secretlint/secretlint-rule-preset-recommend": "^
|
|
107
|
+
"@secretlint/secretlint-rule-preset-recommend": "^9.0.0",
|
|
101
108
|
"@types/node": "18.19.15",
|
|
102
|
-
"@visulima/packem": "1.
|
|
103
|
-
"@vitest/coverage-v8": "^2.1.
|
|
104
|
-
"@vitest/ui": "^2.1.
|
|
109
|
+
"@visulima/packem": "1.9.2",
|
|
110
|
+
"@vitest/coverage-v8": "^2.1.8",
|
|
111
|
+
"@vitest/ui": "^2.1.8",
|
|
105
112
|
"conventional-changelog-conventionalcommits": "8.0.0",
|
|
106
113
|
"cross-env": "^7.0.3",
|
|
107
114
|
"esbuild": "0.24.0",
|
|
@@ -112,15 +119,15 @@
|
|
|
112
119
|
"eslint-plugin-mdx": "^3.1.5",
|
|
113
120
|
"eslint-plugin-vitest": "^0.4.1",
|
|
114
121
|
"eslint-plugin-vitest-globals": "^1.5.0",
|
|
115
|
-
"prettier": "^3.
|
|
122
|
+
"prettier": "^3.4.2",
|
|
116
123
|
"rimraf": "5.0.9",
|
|
117
124
|
"secretlint": "8.2.4",
|
|
118
125
|
"semantic-release": "24.0.0",
|
|
119
126
|
"typescript": "5.4.5",
|
|
120
|
-
"vitest": "^2.1.
|
|
127
|
+
"vitest": "^2.1.8"
|
|
121
128
|
},
|
|
122
129
|
"engines": {
|
|
123
|
-
"node": ">=18.* <=
|
|
130
|
+
"node": ">=18.* <=23.*"
|
|
124
131
|
},
|
|
125
132
|
"os": [
|
|
126
133
|
"darwin",
|