@visulima/is-ansi-color-supported 2.2.0 → 2.2.1
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 +25 -0
- package/README.md +21 -21
- package/dist/is-color-supported.browser.cjs +4 -4
- package/dist/is-color-supported.browser.cjs.map +1 -1
- package/dist/is-color-supported.browser.d.cts +2 -2
- package/dist/is-color-supported.browser.d.ts +2 -2
- package/dist/is-color-supported.browser.js.map +1 -1
- package/dist/is-color-supported.server.cjs +4 -4
- package/dist/is-color-supported.server.d.cts +2 -2
- package/dist/is-color-supported.server.d.ts +2 -2
- package/package.json +151 -151
- /package/dist/{color-spaces-LVm3eRLc.d.cts → color-spaces-DeN59JDX.d.cts} +0 -0
- /package/dist/{color-spaces-LVm3eRLc.d.ts → color-spaces-DeN59JDX.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
## @visulima/is-ansi-color-supported [2.2.1](https://github.com/visulima/visulima/compare/@visulima/is-ansi-color-supported@2.2.0...@visulima/is-ansi-color-supported@2.2.1) (2024-06-06)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* allow node v22 ([890d457](https://github.com/visulima/visulima/commit/890d4570f18428e2463944813c0c638b3f142803))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Styles
|
|
10
|
+
|
|
11
|
+
* cs fixes ([7bf5b91](https://github.com/visulima/visulima/commit/7bf5b91383b612598d955fe23505c94f22a8d277))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Miscellaneous Chores
|
|
15
|
+
|
|
16
|
+
* changed semantic-release-npm to pnpm ([b6d100a](https://github.com/visulima/visulima/commit/b6d100a2bf3fd026577be48726a37754947f0973))
|
|
17
|
+
* **deps:** updated dev deps ([d91ac38](https://github.com/visulima/visulima/commit/d91ac389cea85a6c6bdc8de97905252a6c467abc))
|
|
18
|
+
* update dev dependencies ([068bdbf](https://github.com/visulima/visulima/commit/068bdbfe0b371b5cc7e5ac071dc3310a3b8cea98))
|
|
19
|
+
* update dev dependencies ([09c4854](https://github.com/visulima/visulima/commit/09c4854e221fa8b808dfe66d7196d8db2a39b366))
|
|
20
|
+
* updated dev dependencies ([a2e0504](https://github.com/visulima/visulima/commit/a2e0504dc239049434c2482756ff15bdbaac9b54))
|
|
21
|
+
* updated dev dependencies ([abd319c](https://github.com/visulima/visulima/commit/abd319c23576aa1dc751ac874e806bddbc977d51))
|
|
22
|
+
* updated dev dependencies ([0767afe](https://github.com/visulima/visulima/commit/0767afe9be83da6698c1343724400171f952599e))
|
|
23
|
+
* updated dev dependencies ([d7791e3](https://github.com/visulima/visulima/commit/d7791e327917e438757636573b1e5549a97bba7b))
|
|
24
|
+
* updated dev dependencies ([6005345](https://github.com/visulima/visulima/commit/60053456717a3889fc77b4fb5b05d50a662475b2))
|
|
25
|
+
|
|
1
26
|
## @visulima/is-ansi-color-supported [2.2.0](https://github.com/visulima/visulima/compare/@visulima/is-ansi-color-supported@2.1.0...@visulima/is-ansi-color-supported@2.2.0) (2024-04-09)
|
|
2
27
|
|
|
3
28
|
|
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.
|
|
@@ -71,29 +71,29 @@ CI systems can be detected by checking for the existence of the `CI` and other s
|
|
|
71
71
|
Combine that with the knowledge about which operating system the program is running on, and we have a decent enough way to detect colors.
|
|
72
72
|
|
|
73
73
|
| Terminal | ANSI 16<br>colors | ANSI 256<br>colors | True<br>Color | env.<br>TERM | env.<br>COLORTERM | Specifically ENV variables |
|
|
74
|
-
|
|
75
|
-
| Azure CI | ✅
|
|
76
|
-
| GitHub CI | ✅
|
|
77
|
-
| GitTea CI | ✅
|
|
78
|
-
| GitLab CI | ✅
|
|
79
|
-
| Travis CI | ✅
|
|
80
|
-
| PM2<br>not isTTY | ✅[^1]
|
|
81
|
-
| JetBrains TeamCity<br>>=2020.1.1 | ✅
|
|
82
|
-
| JetBrains IDEA | ✅
|
|
83
|
-
| VS Code | ✅
|
|
84
|
-
| Windows<br>Terminal | ✅
|
|
85
|
-
| Windows<br>PowerShell | ✅
|
|
86
|
-
| macOS Terminal | ✅
|
|
87
|
-
| iTerm | ✅
|
|
88
|
-
| Terminal emulator Kitty | ✅
|
|
74
|
+
| :------------------------------- | ----------------- | :----------------- | :------------ | :------------: | :---------------: | :------------------------------------- |
|
|
75
|
+
| Azure CI | ✅ | ❌ | ❌ | dumb | | TF_BUILD<br>AGENT_NAME |
|
|
76
|
+
| GitHub CI | ✅ | ✅ | ✅ | dumb | | CI<br>GITHUB_ACTIONS |
|
|
77
|
+
| GitTea CI | ✅ | ✅ | ✅ | dumb | | CI<br>GITEA_ACTIONS |
|
|
78
|
+
| GitLab CI | ✅ | ❌ | ❌ | dumb | | CI<br>GITLAB_CI |
|
|
79
|
+
| Travis CI | ✅ | ❌ | ❌ | dumb | | TRAVIS |
|
|
80
|
+
| PM2<br>not isTTY | ✅[^1] | ✅[^1] | ✅[^1] | dumb | | PM2_HOME<br>pm_id |
|
|
81
|
+
| JetBrains TeamCity<br>>=2020.1.1 | ✅ | ✅ | ❌ | | | TEAMCITY_VERSION |
|
|
82
|
+
| JetBrains IDEA | ✅ | ✅ | ✅ | xterm-256color | | TERMINAL_EMULATOR='JetBrains-JediTerm' |
|
|
83
|
+
| VS Code | ✅ | ✅ | ✅ | xterm-256color | truecolor | |
|
|
84
|
+
| Windows<br>Terminal | ✅ | ✅ | ✅[^2] | | | |
|
|
85
|
+
| Windows<br>PowerShell | ✅ | ✅ | ✅[^2] | | | |
|
|
86
|
+
| macOS Terminal | ✅ | ✅ | ❌ | xterm-256color | | |
|
|
87
|
+
| iTerm | ✅ | ✅ | ✅ | xterm-256color | truecolor | |
|
|
88
|
+
| Terminal emulator Kitty | ✅ | ✅ | ✅ | xterm-kitty | | |
|
|
89
89
|
|
|
90
90
|
[^1]: Colors supported depends on actual terminal.
|
|
91
91
|
[^2]: The Windows terminal supports true color since Windows 10 revision 14931 (2016-09-21).
|
|
92
92
|
|
|
93
93
|
See also:
|
|
94
94
|
|
|
95
|
-
-
|
|
96
|
-
-
|
|
95
|
+
- [Truecolor Support in Output Devices](https://github.com/termstandard/colors#truecolor-support-in-output-devices).
|
|
96
|
+
- [So you want to render colors in your terminal](https://marvinh.dev/blog/terminal-colors/).
|
|
97
97
|
|
|
98
98
|
## Environment variables
|
|
99
99
|
|
|
@@ -4,19 +4,19 @@ var chunkVGFXSNOZ_cjs = require('./chunk-VGFXSNOZ.cjs');
|
|
|
4
4
|
|
|
5
5
|
var t=()=>(()=>{if(typeof navigator<"u"){if(navigator.userAgentData&&navigator.userAgentData.brands.find(({b:p})=>p==="Chromium")?.version>93)return 3;if(/\b(Chrome|Chromium)\//.test(navigator.userAgent))return 1}return typeof process<"u"?(process.env.NEXT_RUNTIME??"").includes("edge")?1:0:0})(),S=t,C=t;
|
|
6
6
|
|
|
7
|
-
Object.defineProperty(exports,
|
|
7
|
+
Object.defineProperty(exports, "SPACE_16_COLORS", {
|
|
8
8
|
enumerable: true,
|
|
9
9
|
get: function () { return chunkVGFXSNOZ_cjs.b; }
|
|
10
10
|
});
|
|
11
|
-
Object.defineProperty(exports,
|
|
11
|
+
Object.defineProperty(exports, "SPACE_256_COLORS", {
|
|
12
12
|
enumerable: true,
|
|
13
13
|
get: function () { return chunkVGFXSNOZ_cjs.c; }
|
|
14
14
|
});
|
|
15
|
-
Object.defineProperty(exports,
|
|
15
|
+
Object.defineProperty(exports, "SPACE_MONO", {
|
|
16
16
|
enumerable: true,
|
|
17
17
|
get: function () { return chunkVGFXSNOZ_cjs.a; }
|
|
18
18
|
});
|
|
19
|
-
Object.defineProperty(exports,
|
|
19
|
+
Object.defineProperty(exports, "SPACE_TRUE_COLORS", {
|
|
20
20
|
enumerable: true,
|
|
21
21
|
get: function () { return chunkVGFXSNOZ_cjs.d; }
|
|
22
22
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/is-color-supported.browser.ts"],"names":["isColorSupported","b","isStdoutColorSupported","isStderrColorSupported"],"mappings":"8DAOA,IAAMA,EAAmB,KACpB,IAAM,CACH,GAAI,OAAO,UAAc,IAAa,CAElC,GAAI,UAAU,eAGI,UAAU,cAAc,OAAO,KAAK,CAAC,CAAE,EAAAC,CAAE,IAAqBA,IAAM,UAAU,GAGjF,QAAU,GACjB,MAAO,GAKf,GAAI,wBAAwB,KAAK,UAAU,SAAS,EAChD,MAAO,EAEf,CAIA,OAAI,OAAO,QAAY,KACD,QAAQ,IAAI,cAAgB,IAAI,SAAS,MAAM,EAE/C,EAAkB,EAGjC,CACX,GAAG,EAEMC,EAAyBF,EAEzBG,EAAyBH","sourcesContent":["// Some of this code is taken from https://github.com/chalk/supports-color/blob/main/index.js\n// MIT License\n// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)\n\nimport { SPACE_16_COLORS, SPACE_MONO,SPACE_TRUE_COLORS } from \"./color-spaces\";\nimport type { ColorSupportLevel } from \"./types\";\n\nconst isColorSupported = (): ColorSupportLevel =>\n (() => {\n if (typeof navigator !== \"undefined\") {\n // @ts-expect-error - `navigator` is not defined in Node.\n if (navigator.userAgentData) {\n // @ts-expect-error - `navigator` is not defined in Node.\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access\n const brand = navigator.userAgentData.brands.find(({ b }: { b: string }) => b === \"Chromium\");\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (brand?.version > 93) {\n return SPACE_TRUE_COLORS;\n }\n }\n\n // eslint-disable-next-line regexp/no-unused-capturing-group\n if (/\\b(Chrome|Chromium)\\//.test(navigator.userAgent)) {\n return SPACE_16_COLORS;\n }\n }\n\n // when Next.JS runtime is `edge`, process.stdout is undefined, but colors output is supported\n // runtime values supported colors: `nodejs`, `edge`, `experimental-edge`\n if (typeof process !== \"undefined\") {\n const isNextJS = (process.env.NEXT_RUNTIME ?? \"\").includes(\"edge\");\n\n return isNextJS ? SPACE_16_COLORS : SPACE_MONO;\n }\n\n return SPACE_MONO;\n })();\n\nexport const isStdoutColorSupported = isColorSupported;\n\nexport const isStderrColorSupported = isColorSupported;\n// eslint-disable-next-line import/no-unused-modules\nexport { SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO,SPACE_TRUE_COLORS } from \"./color-spaces\";\n// eslint-disable-next-line import/no-unused-modules\nexport type { ColorSupportLevel } from \"./types\";\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/is-color-supported.browser.ts"],"names":["isColorSupported","b","isStdoutColorSupported","isStderrColorSupported"],"mappings":"8DAOA,IAAMA,EAAmB,KACpB,IAAM,CACH,GAAI,OAAO,UAAc,IAAa,CAElC,GAAI,UAAU,eAGI,UAAU,cAAc,OAAO,KAAK,CAAC,CAAE,EAAAC,CAAE,IAAqBA,IAAM,UAAU,GAGjF,QAAU,GACjB,MAAO,GAKf,GAAI,wBAAwB,KAAK,UAAU,SAAS,EAChD,MAAO,EAEf,CAIA,OAAI,OAAO,QAAY,KACD,QAAQ,IAAI,cAAgB,IAAI,SAAS,MAAM,EAE/C,EAAkB,EAGjC,CACX,GAAG,EAEMC,EAAyBF,EAEzBG,EAAyBH","sourcesContent":["// Some of this code is taken from https://github.com/chalk/supports-color/blob/main/index.js\n// MIT License\n// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)\n\nimport { SPACE_16_COLORS, SPACE_MONO, SPACE_TRUE_COLORS } from \"./color-spaces\";\nimport type { ColorSupportLevel } from \"./types\";\n\nconst isColorSupported = (): ColorSupportLevel =>\n (() => {\n if (typeof navigator !== \"undefined\") {\n // @ts-expect-error - `navigator` is not defined in Node.\n if (navigator.userAgentData) {\n // @ts-expect-error - `navigator` is not defined in Node.\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access\n const brand = navigator.userAgentData.brands.find(({ b }: { b: string }) => b === \"Chromium\");\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (brand?.version > 93) {\n return SPACE_TRUE_COLORS;\n }\n }\n\n // eslint-disable-next-line regexp/no-unused-capturing-group\n if (/\\b(Chrome|Chromium)\\//.test(navigator.userAgent)) {\n return SPACE_16_COLORS;\n }\n }\n\n // when Next.JS runtime is `edge`, process.stdout is undefined, but colors output is supported\n // runtime values supported colors: `nodejs`, `edge`, `experimental-edge`\n if (typeof process !== \"undefined\") {\n const isNextJS = (process.env.NEXT_RUNTIME ?? \"\").includes(\"edge\");\n\n return isNextJS ? SPACE_16_COLORS : SPACE_MONO;\n }\n\n return SPACE_MONO;\n })();\n\nexport const isStdoutColorSupported = isColorSupported;\n\nexport const isStderrColorSupported = isColorSupported;\n// eslint-disable-next-line import/no-unused-modules\nexport { SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO, SPACE_TRUE_COLORS } from \"./color-spaces\";\n// eslint-disable-next-line import/no-unused-modules\nexport type { ColorSupportLevel } from \"./types\";\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ColorSupportLevel } from './color-spaces-
|
|
2
|
-
export { S as SPACE_16_COLORS, a as SPACE_256_COLORS, b as SPACE_MONO, c as SPACE_TRUE_COLORS } from './color-spaces-
|
|
1
|
+
import { C as ColorSupportLevel } from './color-spaces-DeN59JDX.cjs';
|
|
2
|
+
export { S as SPACE_16_COLORS, a as SPACE_256_COLORS, b as SPACE_MONO, c as SPACE_TRUE_COLORS } from './color-spaces-DeN59JDX.cjs';
|
|
3
3
|
|
|
4
4
|
declare const isStdoutColorSupported: () => ColorSupportLevel;
|
|
5
5
|
declare const isStderrColorSupported: () => ColorSupportLevel;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ColorSupportLevel } from './color-spaces-
|
|
2
|
-
export { S as SPACE_16_COLORS, a as SPACE_256_COLORS, b as SPACE_MONO, c as SPACE_TRUE_COLORS } from './color-spaces-
|
|
1
|
+
import { C as ColorSupportLevel } from './color-spaces-DeN59JDX.js';
|
|
2
|
+
export { S as SPACE_16_COLORS, a as SPACE_256_COLORS, b as SPACE_MONO, c as SPACE_TRUE_COLORS } from './color-spaces-DeN59JDX.js';
|
|
3
3
|
|
|
4
4
|
declare const isStdoutColorSupported: () => ColorSupportLevel;
|
|
5
5
|
declare const isStderrColorSupported: () => ColorSupportLevel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/is-color-supported.browser.ts"],"names":["isColorSupported","b","isStdoutColorSupported","isStderrColorSupported"],"mappings":"6DAOA,IAAMA,EAAmB,KACpB,IAAM,CACH,GAAI,OAAO,UAAc,IAAa,CAElC,GAAI,UAAU,eAGI,UAAU,cAAc,OAAO,KAAK,CAAC,CAAE,EAAAC,CAAE,IAAqBA,IAAM,UAAU,GAGjF,QAAU,GACjB,MAAO,GAKf,GAAI,wBAAwB,KAAK,UAAU,SAAS,EAChD,MAAO,EAEf,CAIA,OAAI,OAAO,QAAY,KACD,QAAQ,IAAI,cAAgB,IAAI,SAAS,MAAM,EAE/C,EAAkB,EAGjC,CACX,GAAG,EAEMC,EAAyBF,EAEzBG,EAAyBH","sourcesContent":["// Some of this code is taken from https://github.com/chalk/supports-color/blob/main/index.js\n// MIT License\n// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)\n\nimport { SPACE_16_COLORS, SPACE_MONO,SPACE_TRUE_COLORS } from \"./color-spaces\";\nimport type { ColorSupportLevel } from \"./types\";\n\nconst isColorSupported = (): ColorSupportLevel =>\n (() => {\n if (typeof navigator !== \"undefined\") {\n // @ts-expect-error - `navigator` is not defined in Node.\n if (navigator.userAgentData) {\n // @ts-expect-error - `navigator` is not defined in Node.\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access\n const brand = navigator.userAgentData.brands.find(({ b }: { b: string }) => b === \"Chromium\");\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (brand?.version > 93) {\n return SPACE_TRUE_COLORS;\n }\n }\n\n // eslint-disable-next-line regexp/no-unused-capturing-group\n if (/\\b(Chrome|Chromium)\\//.test(navigator.userAgent)) {\n return SPACE_16_COLORS;\n }\n }\n\n // when Next.JS runtime is `edge`, process.stdout is undefined, but colors output is supported\n // runtime values supported colors: `nodejs`, `edge`, `experimental-edge`\n if (typeof process !== \"undefined\") {\n const isNextJS = (process.env.NEXT_RUNTIME ?? \"\").includes(\"edge\");\n\n return isNextJS ? SPACE_16_COLORS : SPACE_MONO;\n }\n\n return SPACE_MONO;\n })();\n\nexport const isStdoutColorSupported = isColorSupported;\n\nexport const isStderrColorSupported = isColorSupported;\n// eslint-disable-next-line import/no-unused-modules\nexport { SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO,SPACE_TRUE_COLORS } from \"./color-spaces\";\n// eslint-disable-next-line import/no-unused-modules\nexport type { ColorSupportLevel } from \"./types\";\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/is-color-supported.browser.ts"],"names":["isColorSupported","b","isStdoutColorSupported","isStderrColorSupported"],"mappings":"6DAOA,IAAMA,EAAmB,KACpB,IAAM,CACH,GAAI,OAAO,UAAc,IAAa,CAElC,GAAI,UAAU,eAGI,UAAU,cAAc,OAAO,KAAK,CAAC,CAAE,EAAAC,CAAE,IAAqBA,IAAM,UAAU,GAGjF,QAAU,GACjB,MAAO,GAKf,GAAI,wBAAwB,KAAK,UAAU,SAAS,EAChD,MAAO,EAEf,CAIA,OAAI,OAAO,QAAY,KACD,QAAQ,IAAI,cAAgB,IAAI,SAAS,MAAM,EAE/C,EAAkB,EAGjC,CACX,GAAG,EAEMC,EAAyBF,EAEzBG,EAAyBH","sourcesContent":["// Some of this code is taken from https://github.com/chalk/supports-color/blob/main/index.js\n// MIT License\n// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)\n\nimport { SPACE_16_COLORS, SPACE_MONO, SPACE_TRUE_COLORS } from \"./color-spaces\";\nimport type { ColorSupportLevel } from \"./types\";\n\nconst isColorSupported = (): ColorSupportLevel =>\n (() => {\n if (typeof navigator !== \"undefined\") {\n // @ts-expect-error - `navigator` is not defined in Node.\n if (navigator.userAgentData) {\n // @ts-expect-error - `navigator` is not defined in Node.\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access\n const brand = navigator.userAgentData.brands.find(({ b }: { b: string }) => b === \"Chromium\");\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (brand?.version > 93) {\n return SPACE_TRUE_COLORS;\n }\n }\n\n // eslint-disable-next-line regexp/no-unused-capturing-group\n if (/\\b(Chrome|Chromium)\\//.test(navigator.userAgent)) {\n return SPACE_16_COLORS;\n }\n }\n\n // when Next.JS runtime is `edge`, process.stdout is undefined, but colors output is supported\n // runtime values supported colors: `nodejs`, `edge`, `experimental-edge`\n if (typeof process !== \"undefined\") {\n const isNextJS = (process.env.NEXT_RUNTIME ?? \"\").includes(\"edge\");\n\n return isNextJS ? SPACE_16_COLORS : SPACE_MONO;\n }\n\n return SPACE_MONO;\n })();\n\nexport const isStdoutColorSupported = isColorSupported;\n\nexport const isStderrColorSupported = isColorSupported;\n// eslint-disable-next-line import/no-unused-modules\nexport { SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO, SPACE_TRUE_COLORS } from \"./color-spaces\";\n// eslint-disable-next-line import/no-unused-modules\nexport type { ColorSupportLevel } from \"./types\";\n"]}
|
|
@@ -4,19 +4,19 @@ var chunkVGFXSNOZ_cjs = require('./chunk-VGFXSNOZ.cjs');
|
|
|
4
4
|
|
|
5
5
|
var d=a=>{let l=globalThis,R=l.Deno!=null,n=l.process??l.Deno??{},E=n.argv??n.args??[],O=t=>{let _=E.indexOf("--"),S=E.findIndex(A=>t.test(A));return S!==-1&&(_===-1||S<_)},r={};try{r=R?n.env.toObject():n.env??{};}catch{}let p="FORCE_COLOR",m=p in r,i=r[p]?String(r[p]):void 0,T=Object.prototype.toString.call(i).slice(8,-1)==="String",o;if(i==="true"?o=1:i==="false"?o=0:T&&i.length===0?o=1:T&&i.length>0&&(o=Math.min(Number.parseInt(i,10),3)),i!=="true"&&i!=="false"&&o!==void 0&&o<4)return o;if("NO_COLOR"in r||m&&o===0||O(/^-{1,2}(no-color|no-colors|color=false|color=never)$/))return 0;if(O(/^-{1,2}(color=256)$/))return 2;if(O(/^-{1,2}(color=16m|color=full|color=truecolor)$/))return 3;if(O(/^-{1,2}(color|colors|color=true|color=always)$/))return 1;let C=o||0;if("TF_BUILD"in r&&"AGENT_NAME"in r)return 1;if(r.TERM&&/-mono|dumb/i.test(r.TERM))return C;if((R?l.Deno.build.os:n.platform)==="win32")try{let t=(R?l.Deno.osRelease():n.os.release()).split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}catch{}if("CI"in r)return "GITHUB_ACTIONS"in r||"GITHUB_WORKFLOW"in r||"GITEA_ACTIONS"in r?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE","GITLAB_CI"].some(t=>t in r)||r.CI_NAME==="codeship"?1:C;if(r.TERMINAL_EMULATOR?.includes("JediTerm"))return 3;if("TEAMCITY_VERSION"in r)return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if(r.COLORTERM==="truecolor")return 3;if(r.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in r){let t=Number.parseInt((r.TERM_PROGRAM_VERSION??"").split(".")[0],10);if(r.TERM_PROGRAM==="iTerm.app")return t>=3?3:2;if(r.TERM_PROGRAM==="Apple_Terminal")return 2}if(/-256(color)?$/i.test(r.TERM))return 2;let c=!1;return R?a==="out"?c=l.Deno.stdout.isTerminal():a==="err"&&(c=l.Deno.stderr.isTerminal()):"PM2_HOME"in r&&"pm_id"in r?c=!0:c=n["std"+a]&&"isTTY"in n["std"+a],c&&/^screen|^tmux|^xterm|^vt[1-5]\d\d|^ansi|color|mintty|rxvt|cygwin|linux/i.test(r.TERM)?1:"COLORTERM"in r?1:C},b=()=>d("out"),v=()=>d("err");
|
|
6
6
|
|
|
7
|
-
Object.defineProperty(exports,
|
|
7
|
+
Object.defineProperty(exports, "SPACE_16_COLORS", {
|
|
8
8
|
enumerable: true,
|
|
9
9
|
get: function () { return chunkVGFXSNOZ_cjs.b; }
|
|
10
10
|
});
|
|
11
|
-
Object.defineProperty(exports,
|
|
11
|
+
Object.defineProperty(exports, "SPACE_256_COLORS", {
|
|
12
12
|
enumerable: true,
|
|
13
13
|
get: function () { return chunkVGFXSNOZ_cjs.c; }
|
|
14
14
|
});
|
|
15
|
-
Object.defineProperty(exports,
|
|
15
|
+
Object.defineProperty(exports, "SPACE_MONO", {
|
|
16
16
|
enumerable: true,
|
|
17
17
|
get: function () { return chunkVGFXSNOZ_cjs.a; }
|
|
18
18
|
});
|
|
19
|
-
Object.defineProperty(exports,
|
|
19
|
+
Object.defineProperty(exports, "SPACE_TRUE_COLORS", {
|
|
20
20
|
enumerable: true,
|
|
21
21
|
get: function () { return chunkVGFXSNOZ_cjs.d; }
|
|
22
22
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ColorSupportLevel } from './color-spaces-
|
|
2
|
-
export { S as SPACE_16_COLORS, a as SPACE_256_COLORS, b as SPACE_MONO, c as SPACE_TRUE_COLORS } from './color-spaces-
|
|
1
|
+
import { C as ColorSupportLevel } from './color-spaces-DeN59JDX.cjs';
|
|
2
|
+
export { S as SPACE_16_COLORS, a as SPACE_256_COLORS, b as SPACE_MONO, c as SPACE_TRUE_COLORS } from './color-spaces-DeN59JDX.cjs';
|
|
3
3
|
|
|
4
4
|
declare const isStdoutColorSupported: () => ColorSupportLevel;
|
|
5
5
|
declare const isStderrColorSupported: () => ColorSupportLevel;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ColorSupportLevel } from './color-spaces-
|
|
2
|
-
export { S as SPACE_16_COLORS, a as SPACE_256_COLORS, b as SPACE_MONO, c as SPACE_TRUE_COLORS } from './color-spaces-
|
|
1
|
+
import { C as ColorSupportLevel } from './color-spaces-DeN59JDX.js';
|
|
2
|
+
export { S as SPACE_16_COLORS, a as SPACE_256_COLORS, b as SPACE_MONO, c as SPACE_TRUE_COLORS } from './color-spaces-DeN59JDX.js';
|
|
3
3
|
|
|
4
4
|
declare const isStdoutColorSupported: () => ColorSupportLevel;
|
|
5
5
|
declare const isStderrColorSupported: () => ColorSupportLevel;
|
package/package.json
CHANGED
|
@@ -1,154 +1,154 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
2
|
+
"name": "@visulima/is-ansi-color-supported",
|
|
3
|
+
"version": "2.2.1",
|
|
4
|
+
"description": "Detect whether a terminal or browser supports ansi colors.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"anolilab",
|
|
7
|
+
"visulima",
|
|
8
|
+
"colorize",
|
|
9
|
+
"ansi",
|
|
10
|
+
"colour",
|
|
11
|
+
"color",
|
|
12
|
+
"colors",
|
|
13
|
+
"styles",
|
|
14
|
+
"terminal",
|
|
15
|
+
"xterm",
|
|
16
|
+
"console",
|
|
17
|
+
"cli",
|
|
18
|
+
"truecolor",
|
|
19
|
+
"FORCE_COLOR",
|
|
20
|
+
"NO_COLOR",
|
|
21
|
+
"ansi-colors",
|
|
22
|
+
"style",
|
|
23
|
+
"tty",
|
|
24
|
+
"256",
|
|
25
|
+
"detect",
|
|
26
|
+
"edge",
|
|
27
|
+
"next.js",
|
|
28
|
+
"nextjs",
|
|
29
|
+
"support",
|
|
30
|
+
"supports",
|
|
31
|
+
"capability",
|
|
32
|
+
"shell",
|
|
33
|
+
"command-line"
|
|
34
|
+
],
|
|
35
|
+
"homepage": "https://www.visulima.com/docs/package/is-ansi-color-supported",
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "https://github.com/visulima/visulima.git",
|
|
39
|
+
"directory": "packages/is-ansi-color-supported"
|
|
40
|
+
},
|
|
41
|
+
"funding": [
|
|
42
|
+
{
|
|
43
|
+
"type": "github",
|
|
44
|
+
"url": "https://github.com/sponsors/prisis"
|
|
40
45
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
46
|
+
{
|
|
47
|
+
"type": "consulting",
|
|
48
|
+
"url": "https://anolilab.com/support"
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"license": "MIT",
|
|
52
|
+
"author": {
|
|
53
|
+
"name": "Daniel Bannert",
|
|
54
|
+
"email": "d.bannert@anolilab.de"
|
|
55
|
+
},
|
|
56
|
+
"sideEffects": false,
|
|
57
|
+
"type": "module",
|
|
58
|
+
"exports": {
|
|
59
|
+
".": {
|
|
60
|
+
"browser": "./dist/is-color-supported.browser.js",
|
|
61
|
+
"require": {
|
|
62
|
+
"types": "./dist/is-color-supported.server.d.cts",
|
|
63
|
+
"default": "./dist/is-color-supported.server.cjs"
|
|
64
|
+
},
|
|
65
|
+
"import": {
|
|
66
|
+
"types": "./dist/is-color-supported.server.d.ts",
|
|
67
|
+
"default": "./dist/is-color-supported.server.js"
|
|
68
|
+
}
|
|
55
69
|
},
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
"
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
"
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
"
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
"
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
"
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
"
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
"tsdoc": false
|
|
142
|
-
},
|
|
143
|
-
"warn_on_unsupported_typescript_version": false,
|
|
144
|
-
"info_on_disabling_jsx_react_rule": false,
|
|
145
|
-
"info_on_disabling_prettier_conflict_rule": false,
|
|
146
|
-
"info_on_disabling_jsonc_sort_keys_rule": false,
|
|
147
|
-
"info_on_disabling_etc_no_deprecated": false
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
"sources": [
|
|
151
|
-
"src/is-color-supported.browser.ts",
|
|
152
|
-
"src/is-color-supported.server.ts"
|
|
153
|
-
]
|
|
154
|
-
}
|
|
70
|
+
"./package.json": "./package.json"
|
|
71
|
+
},
|
|
72
|
+
"main": "dist/is-color-supported.server.cjs",
|
|
73
|
+
"module": "dist/is-color-supported.server.js",
|
|
74
|
+
"browser": "./dist/is-color-supported.browser.js",
|
|
75
|
+
"types": "dist/is-color-supported.server.d.ts",
|
|
76
|
+
"files": [
|
|
77
|
+
"dist/**",
|
|
78
|
+
"README.md",
|
|
79
|
+
"CHANGELOG.md",
|
|
80
|
+
"LICENSE.md"
|
|
81
|
+
],
|
|
82
|
+
"devDependencies": {
|
|
83
|
+
"@anolilab/eslint-config": "^15.0.3",
|
|
84
|
+
"@anolilab/prettier-config": "^5.0.14",
|
|
85
|
+
"@anolilab/semantic-release-pnpm": "^1.1.0",
|
|
86
|
+
"@anolilab/semantic-release-preset": "^8.1.0",
|
|
87
|
+
"@babel/core": "^7.24.6",
|
|
88
|
+
"@rushstack/eslint-plugin-security": "^0.8.1",
|
|
89
|
+
"@secretlint/secretlint-rule-preset-recommend": "^8.2.4",
|
|
90
|
+
"@types/micromatch": "^4.0.7",
|
|
91
|
+
"@types/node": "18.18.14",
|
|
92
|
+
"@vitest/coverage-v8": "^1.6.0",
|
|
93
|
+
"@vitest/ui": "^1.6.0",
|
|
94
|
+
"cross-env": "^7.0.3",
|
|
95
|
+
"eslint": "^8.57.0",
|
|
96
|
+
"eslint-plugin-deprecation": "^3.0.0",
|
|
97
|
+
"eslint-plugin-etc": "^2.0.3",
|
|
98
|
+
"eslint-plugin-import": "npm:eslint-plugin-i@^2.29.1",
|
|
99
|
+
"eslint-plugin-mdx": "^3.1.5",
|
|
100
|
+
"eslint-plugin-vitest": "^0.4.1",
|
|
101
|
+
"eslint-plugin-vitest-globals": "^1.5.0",
|
|
102
|
+
"prettier": "^3.3.0",
|
|
103
|
+
"rimraf": "^5.0.7",
|
|
104
|
+
"secretlint": "8.2.3",
|
|
105
|
+
"semantic-release": "23.1.1",
|
|
106
|
+
"tsup": "^8.1.0",
|
|
107
|
+
"typescript": "^5.4.5",
|
|
108
|
+
"vitest": "^1.6.0"
|
|
109
|
+
},
|
|
110
|
+
"engines": {
|
|
111
|
+
"node": ">=18.* <=22.*"
|
|
112
|
+
},
|
|
113
|
+
"os": [
|
|
114
|
+
"darwin",
|
|
115
|
+
"linux",
|
|
116
|
+
"win32"
|
|
117
|
+
],
|
|
118
|
+
"publishConfig": {
|
|
119
|
+
"access": "public",
|
|
120
|
+
"provenance": true
|
|
121
|
+
},
|
|
122
|
+
"anolilab": {
|
|
123
|
+
"eslint-config": {
|
|
124
|
+
"plugin": {
|
|
125
|
+
"tsdoc": false
|
|
126
|
+
},
|
|
127
|
+
"warn_on_unsupported_typescript_version": false,
|
|
128
|
+
"info_on_disabling_jsx_react_rule": false,
|
|
129
|
+
"info_on_disabling_prettier_conflict_rule": false,
|
|
130
|
+
"info_on_disabling_jsonc_sort_keys_rule": false,
|
|
131
|
+
"info_on_disabling_etc_no_deprecated": false
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"sources": [
|
|
135
|
+
"src/is-color-supported.browser.ts",
|
|
136
|
+
"src/is-color-supported.server.ts"
|
|
137
|
+
],
|
|
138
|
+
"scripts": {
|
|
139
|
+
"build": "cross-env NODE_ENV=development tsup",
|
|
140
|
+
"build:prod": "cross-env NODE_ENV=production tsup",
|
|
141
|
+
"clean": "rimraf node_modules dist .eslintcache",
|
|
142
|
+
"dev": "pnpm run build --watch",
|
|
143
|
+
"lint:eslint": "eslint . --ext js,cjs,mjs,jsx,ts,tsx,json,yaml,yml,md,mdx --max-warnings=0 --config .eslintrc.cjs",
|
|
144
|
+
"lint:eslint:fix": "eslint . --ext js,cjs,mjs,jsx,ts,tsx,json,yaml,yml,md,mdx --max-warnings=0 --config .eslintrc.cjs --fix",
|
|
145
|
+
"lint:package-json": "publint --strict",
|
|
146
|
+
"lint:prettier": "prettier --config=.prettierrc.cjs --check .",
|
|
147
|
+
"lint:prettier:fix": "prettier --config=.prettierrc.cjs --write .",
|
|
148
|
+
"lint:types": "tsc --noEmit",
|
|
149
|
+
"test": "vitest run",
|
|
150
|
+
"test:coverage": "vitest run --coverage",
|
|
151
|
+
"test:ui": "vitest --ui --coverage.enabled=true",
|
|
152
|
+
"test:watch": "vitest"
|
|
153
|
+
}
|
|
154
|
+
}
|
|
File without changes
|
|
File without changes
|