@visulima/is-ansi-color-supported 3.0.0-alpha.10 → 3.0.0-alpha.12
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 +34 -0
- package/dist/is-color-supported.browser.cjs +1 -30
- package/dist/is-color-supported.browser.d.cts +15 -5
- package/dist/is-color-supported.browser.d.mts +15 -5
- package/dist/is-color-supported.browser.d.ts +15 -5
- package/dist/is-color-supported.browser.mjs +1 -22
- package/dist/is-color-supported.edge-light.cjs +1 -38
- package/dist/is-color-supported.edge-light.d.cts +15 -5
- package/dist/is-color-supported.edge-light.d.mts +15 -5
- package/dist/is-color-supported.edge-light.d.ts +15 -5
- package/dist/is-color-supported.edge-light.mjs +1 -30
- package/dist/is-color-supported.server.cjs +1 -145
- package/dist/is-color-supported.server.d.cts +15 -5
- package/dist/is-color-supported.server.d.mts +15 -5
- package/dist/is-color-supported.server.d.ts +15 -5
- package/dist/is-color-supported.server.mjs +1 -136
- package/dist/packem_shared/SPACE_MONO-BEQbKWNs.mjs +1 -0
- package/dist/packem_shared/SPACE_MONO-CIFY-d7-.cjs +1 -0
- package/package.json +29 -31
- package/dist/color-spaces.d.cts +0 -4
- package/dist/color-spaces.d.mts +0 -4
- package/dist/color-spaces.d.ts +0 -4
- package/dist/packem_shared/SPACE_MONO-Cwv43lY6.cjs +0 -13
- package/dist/packem_shared/SPACE_MONO-VdlYcTli.mjs +0 -6
- package/dist/types.d.cts +0 -8
- package/dist/types.d.mts +0 -8
- package/dist/types.d.ts +0 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,37 @@
|
|
|
1
|
+
## @visulima/is-ansi-color-supported [3.0.0-alpha.12](https://github.com/visulima/visulima/compare/@visulima/is-ansi-color-supported@3.0.0-alpha.11...@visulima/is-ansi-color-supported@3.0.0-alpha.12) (2026-06-04)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **is-ansi-color-supported:** 2 bug fixes ([0e1fd0c](https://github.com/visulima/visulima/commit/0e1fd0cba80160781b8136d44506afd7f3219dd8))
|
|
6
|
+
|
|
7
|
+
### Tests
|
|
8
|
+
|
|
9
|
+
* **is-ansi-color-supported:** cover edge-light runtime, browser userAgentData, and server ci/term paths ([8633292](https://github.com/visulima/visulima/commit/863329255aaa41530e741808b197bebd8f63b70d))
|
|
10
|
+
|
|
11
|
+
## @visulima/is-ansi-color-supported [3.0.0-alpha.11](https://github.com/visulima/visulima/compare/@visulima/is-ansi-color-supported@3.0.0-alpha.10...@visulima/is-ansi-color-supported@3.0.0-alpha.11) (2026-05-27)
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **storage-client:** percent-encode user fields in defaultFingerprint ([7c78a0f](https://github.com/visulima/visulima/commit/7c78a0f9512e2a673b941d80839e9f1e86b7b5d0))
|
|
16
|
+
|
|
17
|
+
### Documentation
|
|
18
|
+
|
|
19
|
+
* prettier-format agent instructions ([71b6414](https://github.com/visulima/visulima/commit/71b6414528780ac82c4e0bb25b5f4f11faba5549))
|
|
20
|
+
|
|
21
|
+
### Miscellaneous Chores
|
|
22
|
+
|
|
23
|
+
* **ci-stability:** green CI across vis, native, lint, tests, attw ([#651](https://github.com/visulima/visulima/issues/651)) ([d4eb684](https://github.com/visulima/visulima/commit/d4eb684b5f75c818c9251048c605a0ed54a268e3))
|
|
24
|
+
* **is-ansi-color-supported:** housekeeping cleanup ([b47f21c](https://github.com/visulima/visulima/commit/b47f21c5b55a7b976d9cfc052657b740ae57a142))
|
|
25
|
+
* **is-ansi-color-supported:** upgrade packem to 2.0.0-alpha.76 ([9bdb5a9](https://github.com/visulima/visulima/commit/9bdb5a93391c5af6536b09ac4baf6af92785e8ce))
|
|
26
|
+
* re-sort workspace package.json files via vis sort-package-json ([f625696](https://github.com/visulima/visulima/commit/f625696cfac974325774b3243e1a83c3d23acbd7))
|
|
27
|
+
* refresh generated license bundles and disposable-domain stats ([a389f38](https://github.com/visulima/visulima/commit/a389f38484788aafa8ba9b698e2dd5805a982d98))
|
|
28
|
+
* **repo:** sort package.json keys across all packages ([e1fd9ab](https://github.com/visulima/visulima/commit/e1fd9ab467ef96a98c777da1572ff6a50fcf7e71))
|
|
29
|
+
* sorted package.json ([b47c545](https://github.com/visulima/visulima/commit/b47c545591600fdab17d5cd3a3fbc68b61e199da))
|
|
30
|
+
|
|
31
|
+
### Tests
|
|
32
|
+
|
|
33
|
+
* **repo:** add dist runtime + types integration tests ([32ee300](https://github.com/visulima/visulima/commit/32ee300b7184117a0ddf9f9d390f75f8932d5ed9))
|
|
34
|
+
|
|
1
35
|
## @visulima/is-ansi-color-supported [3.0.0-alpha.10](https://github.com/visulima/visulima/compare/@visulima/is-ansi-color-supported@3.0.0-alpha.9...@visulima/is-ansi-color-supported@3.0.0-alpha.10) (2026-04-22)
|
|
2
36
|
|
|
3
37
|
### Bug Fixes
|
|
@@ -1,30 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
-
|
|
5
|
-
const SPACE_MONO = require('./packem_shared/SPACE_MONO-Cwv43lY6.cjs');
|
|
6
|
-
|
|
7
|
-
const CHROME_CHROMIUM_RE = /\b(Chrome|Chromium)\//;
|
|
8
|
-
const isColorSupported = () => (() => {
|
|
9
|
-
if (typeof navigator !== "undefined") {
|
|
10
|
-
if (navigator.userAgentData) {
|
|
11
|
-
const brand = navigator.userAgentData.brands.find(({ b }) => b === "Chromium");
|
|
12
|
-
if (brand?.version > 93) {
|
|
13
|
-
return SPACE_MONO.SPACE_TRUE_COLORS;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
if (CHROME_CHROMIUM_RE.test(navigator.userAgent)) {
|
|
17
|
-
return SPACE_MONO.SPACE_16_COLORS;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return SPACE_MONO.SPACE_MONO;
|
|
21
|
-
})();
|
|
22
|
-
const isStdoutColorSupported = isColorSupported;
|
|
23
|
-
const isStderrColorSupported = isColorSupported;
|
|
24
|
-
|
|
25
|
-
exports.SPACE_16_COLORS = SPACE_MONO.SPACE_16_COLORS;
|
|
26
|
-
exports.SPACE_256_COLORS = SPACE_MONO.SPACE_256_COLORS;
|
|
27
|
-
exports.SPACE_MONO = SPACE_MONO.SPACE_MONO;
|
|
28
|
-
exports.SPACE_TRUE_COLORS = SPACE_MONO.SPACE_TRUE_COLORS;
|
|
29
|
-
exports.isStderrColorSupported = isStderrColorSupported;
|
|
30
|
-
exports.isStdoutColorSupported = isStdoutColorSupported;
|
|
1
|
+
"use strict";var C=Object.defineProperty;var o=(e,t)=>C(e,"name",{value:t,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./packem_shared/SPACE_MONO-CIFY-d7-.cjs");var u=Object.defineProperty,O=o((e,t)=>u(e,"name",{value:t,configurable:!0}),"t");const i=/\b(Chrome|Chromium)\//,S=O(()=>(()=>{if(typeof navigator<"u"){if(navigator.userAgentData){const e=navigator.userAgentData.brands.find(({brand:t})=>t==="Chromium");if(Number(e?.version)>93)return r.SPACE_TRUE_COLORS}if(i.test(navigator.userAgent))return r.SPACE_16_COLORS}return r.SPACE_MONO})(),"isColorSupported"),n=S,a=S;exports.SPACE_16_COLORS=r.SPACE_16_COLORS;exports.SPACE_256_COLORS=r.SPACE_256_COLORS;exports.SPACE_MONO=r.SPACE_MONO;exports.SPACE_TRUE_COLORS=r.SPACE_TRUE_COLORS;exports.isStderrColorSupported=a;exports.isStdoutColorSupported=n;
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Levels:
|
|
3
|
+
* - `0` - All colors disabled.
|
|
4
|
+
* - `1` - Basic 16 colors support.
|
|
5
|
+
* - `2` - ANSI 256 colors support.
|
|
6
|
+
* - `3` - Truecolor 16 million colors support.
|
|
7
|
+
*/
|
|
8
|
+
type ColorSupportLevel = 0 | 1 | 2 | 3;
|
|
9
|
+
declare const SPACE_MONO = 0;
|
|
10
|
+
declare const SPACE_16_COLORS = 1;
|
|
11
|
+
declare const SPACE_256_COLORS = 2;
|
|
12
|
+
declare const SPACE_TRUE_COLORS = 3;
|
|
13
|
+
declare const isStdoutColorSupported: () => ColorSupportLevel;
|
|
14
|
+
declare const isStderrColorSupported: () => ColorSupportLevel;
|
|
15
|
+
export { type ColorSupportLevel, SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO, SPACE_TRUE_COLORS, isStderrColorSupported, isStdoutColorSupported };
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Levels:
|
|
3
|
+
* - `0` - All colors disabled.
|
|
4
|
+
* - `1` - Basic 16 colors support.
|
|
5
|
+
* - `2` - ANSI 256 colors support.
|
|
6
|
+
* - `3` - Truecolor 16 million colors support.
|
|
7
|
+
*/
|
|
8
|
+
type ColorSupportLevel = 0 | 1 | 2 | 3;
|
|
9
|
+
declare const SPACE_MONO = 0;
|
|
10
|
+
declare const SPACE_16_COLORS = 1;
|
|
11
|
+
declare const SPACE_256_COLORS = 2;
|
|
12
|
+
declare const SPACE_TRUE_COLORS = 3;
|
|
13
|
+
declare const isStdoutColorSupported: () => ColorSupportLevel;
|
|
14
|
+
declare const isStderrColorSupported: () => ColorSupportLevel;
|
|
15
|
+
export { type ColorSupportLevel, SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO, SPACE_TRUE_COLORS, isStderrColorSupported, isStdoutColorSupported };
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Levels:
|
|
3
|
+
* - `0` - All colors disabled.
|
|
4
|
+
* - `1` - Basic 16 colors support.
|
|
5
|
+
* - `2` - ANSI 256 colors support.
|
|
6
|
+
* - `3` - Truecolor 16 million colors support.
|
|
7
|
+
*/
|
|
8
|
+
type ColorSupportLevel = 0 | 1 | 2 | 3;
|
|
9
|
+
declare const SPACE_MONO = 0;
|
|
10
|
+
declare const SPACE_16_COLORS = 1;
|
|
11
|
+
declare const SPACE_256_COLORS = 2;
|
|
12
|
+
declare const SPACE_TRUE_COLORS = 3;
|
|
13
|
+
declare const isStdoutColorSupported: () => ColorSupportLevel;
|
|
14
|
+
declare const isStderrColorSupported: () => ColorSupportLevel;
|
|
15
|
+
export { type ColorSupportLevel, SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO, SPACE_TRUE_COLORS, isStderrColorSupported, isStdoutColorSupported };
|
|
@@ -1,22 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { SPACE_256_COLORS } from './packem_shared/SPACE_MONO-VdlYcTli.mjs';
|
|
3
|
-
|
|
4
|
-
const CHROME_CHROMIUM_RE = /\b(Chrome|Chromium)\//;
|
|
5
|
-
const isColorSupported = () => (() => {
|
|
6
|
-
if (typeof navigator !== "undefined") {
|
|
7
|
-
if (navigator.userAgentData) {
|
|
8
|
-
const brand = navigator.userAgentData.brands.find(({ b }) => b === "Chromium");
|
|
9
|
-
if (brand?.version > 93) {
|
|
10
|
-
return SPACE_TRUE_COLORS;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
if (CHROME_CHROMIUM_RE.test(navigator.userAgent)) {
|
|
14
|
-
return SPACE_16_COLORS;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return SPACE_MONO;
|
|
18
|
-
})();
|
|
19
|
-
const isStdoutColorSupported = isColorSupported;
|
|
20
|
-
const isStderrColorSupported = isColorSupported;
|
|
21
|
-
|
|
22
|
-
export { SPACE_16_COLORS, SPACE_MONO, SPACE_TRUE_COLORS, isStderrColorSupported, isStdoutColorSupported };
|
|
1
|
+
var n=Object.defineProperty;var e=(r,t)=>n(r,"name",{value:t,configurable:!0});import{SPACE_TRUE_COLORS as a,SPACE_16_COLORS as i,SPACE_MONO as u}from"./packem_shared/SPACE_MONO-BEQbKWNs.mjs";import{SPACE_256_COLORS as v}from"./packem_shared/SPACE_MONO-BEQbKWNs.mjs";var C=Object.defineProperty,p=e((r,t)=>C(r,"name",{value:t,configurable:!0}),"t");const s=/\b(Chrome|Chromium)\//,o=p(()=>(()=>{if(typeof navigator<"u"){if(navigator.userAgentData){const r=navigator.userAgentData.brands.find(({brand:t})=>t==="Chromium");if(Number(r?.version)>93)return a}if(s.test(navigator.userAgent))return i}return u})(),"isColorSupported"),m=o,d=o;export{i as SPACE_16_COLORS,v as SPACE_256_COLORS,u as SPACE_MONO,a as SPACE_TRUE_COLORS,d as isStderrColorSupported,m as isStdoutColorSupported};
|
|
@@ -1,38 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
-
|
|
5
|
-
const SPACE_MONO = require('./packem_shared/SPACE_MONO-Cwv43lY6.cjs');
|
|
6
|
-
|
|
7
|
-
const CHROME_CHROMIUM_RE = /\b(Chrome|Chromium)\//;
|
|
8
|
-
const isColorSupported$1 = () => (() => {
|
|
9
|
-
if (typeof navigator !== "undefined") {
|
|
10
|
-
if (navigator.userAgentData) {
|
|
11
|
-
const brand = navigator.userAgentData.brands.find(({ b }) => b === "Chromium");
|
|
12
|
-
if (brand?.version > 93) {
|
|
13
|
-
return SPACE_MONO.SPACE_TRUE_COLORS;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
if (CHROME_CHROMIUM_RE.test(navigator.userAgent)) {
|
|
17
|
-
return SPACE_MONO.SPACE_16_COLORS;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return SPACE_MONO.SPACE_MONO;
|
|
21
|
-
})();
|
|
22
|
-
const isStdoutColorSupported$1 = isColorSupported$1;
|
|
23
|
-
|
|
24
|
-
const isColorSupported = () => (() => {
|
|
25
|
-
if (process.env.NEXT_RUNTIME?.includes("edge")) {
|
|
26
|
-
return SPACE_MONO.SPACE_16_COLORS;
|
|
27
|
-
}
|
|
28
|
-
return isStdoutColorSupported$1();
|
|
29
|
-
})();
|
|
30
|
-
const isStdoutColorSupported = isColorSupported;
|
|
31
|
-
const isStderrColorSupported = isColorSupported;
|
|
32
|
-
|
|
33
|
-
exports.SPACE_16_COLORS = SPACE_MONO.SPACE_16_COLORS;
|
|
34
|
-
exports.SPACE_256_COLORS = SPACE_MONO.SPACE_256_COLORS;
|
|
35
|
-
exports.SPACE_MONO = SPACE_MONO.SPACE_MONO;
|
|
36
|
-
exports.SPACE_TRUE_COLORS = SPACE_MONO.SPACE_TRUE_COLORS;
|
|
37
|
-
exports.isStderrColorSupported = isStderrColorSupported;
|
|
38
|
-
exports.isStdoutColorSupported = isStdoutColorSupported;
|
|
1
|
+
"use strict";var u=Object.defineProperty;var o=(e,t)=>u(e,"name",{value:t,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./packem_shared/SPACE_MONO-CIFY-d7-.cjs");var C=Object.defineProperty,i=o((e,t)=>C(e,"name",{value:t,configurable:!0}),"t$1");const n=/\b(Chrome|Chromium)\//,O=i(()=>(()=>{if(typeof navigator<"u"){if(navigator.userAgentData){const e=navigator.userAgentData.brands.find(({brand:t})=>t==="Chromium");if(Number(e?.version)>93)return r.SPACE_TRUE_COLORS}if(n.test(navigator.userAgent))return r.SPACE_16_COLORS}return r.SPACE_MONO})(),"isColorSupported"),a=O;var s=Object.defineProperty,_=o((e,t)=>s(e,"name",{value:t,configurable:!0}),"o");const S=_(()=>process.env.NEXT_RUNTIME?.includes("edge")?r.SPACE_16_COLORS:a(),"isColorSupported"),d=S,p=S;exports.SPACE_16_COLORS=r.SPACE_16_COLORS;exports.SPACE_256_COLORS=r.SPACE_256_COLORS;exports.SPACE_MONO=r.SPACE_MONO;exports.SPACE_TRUE_COLORS=r.SPACE_TRUE_COLORS;exports.isStderrColorSupported=p;exports.isStdoutColorSupported=d;
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Levels:
|
|
3
|
+
* - `0` - All colors disabled.
|
|
4
|
+
* - `1` - Basic 16 colors support.
|
|
5
|
+
* - `2` - ANSI 256 colors support.
|
|
6
|
+
* - `3` - Truecolor 16 million colors support.
|
|
7
|
+
*/
|
|
8
|
+
type ColorSupportLevel = 0 | 1 | 2 | 3;
|
|
9
|
+
declare const SPACE_MONO = 0;
|
|
10
|
+
declare const SPACE_16_COLORS = 1;
|
|
11
|
+
declare const SPACE_256_COLORS = 2;
|
|
12
|
+
declare const SPACE_TRUE_COLORS = 3;
|
|
13
|
+
declare const isStdoutColorSupported: () => ColorSupportLevel;
|
|
14
|
+
declare const isStderrColorSupported: () => ColorSupportLevel;
|
|
15
|
+
export { type ColorSupportLevel, SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO, SPACE_TRUE_COLORS, isStderrColorSupported, isStdoutColorSupported };
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Levels:
|
|
3
|
+
* - `0` - All colors disabled.
|
|
4
|
+
* - `1` - Basic 16 colors support.
|
|
5
|
+
* - `2` - ANSI 256 colors support.
|
|
6
|
+
* - `3` - Truecolor 16 million colors support.
|
|
7
|
+
*/
|
|
8
|
+
type ColorSupportLevel = 0 | 1 | 2 | 3;
|
|
9
|
+
declare const SPACE_MONO = 0;
|
|
10
|
+
declare const SPACE_16_COLORS = 1;
|
|
11
|
+
declare const SPACE_256_COLORS = 2;
|
|
12
|
+
declare const SPACE_TRUE_COLORS = 3;
|
|
13
|
+
declare const isStdoutColorSupported: () => ColorSupportLevel;
|
|
14
|
+
declare const isStderrColorSupported: () => ColorSupportLevel;
|
|
15
|
+
export { type ColorSupportLevel, SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO, SPACE_TRUE_COLORS, isStderrColorSupported, isStdoutColorSupported };
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Levels:
|
|
3
|
+
* - `0` - All colors disabled.
|
|
4
|
+
* - `1` - Basic 16 colors support.
|
|
5
|
+
* - `2` - ANSI 256 colors support.
|
|
6
|
+
* - `3` - Truecolor 16 million colors support.
|
|
7
|
+
*/
|
|
8
|
+
type ColorSupportLevel = 0 | 1 | 2 | 3;
|
|
9
|
+
declare const SPACE_MONO = 0;
|
|
10
|
+
declare const SPACE_16_COLORS = 1;
|
|
11
|
+
declare const SPACE_256_COLORS = 2;
|
|
12
|
+
declare const SPACE_TRUE_COLORS = 3;
|
|
13
|
+
declare const isStdoutColorSupported: () => ColorSupportLevel;
|
|
14
|
+
declare const isStderrColorSupported: () => ColorSupportLevel;
|
|
15
|
+
export { type ColorSupportLevel, SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO, SPACE_TRUE_COLORS, isStderrColorSupported, isStdoutColorSupported };
|
|
@@ -1,30 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { SPACE_256_COLORS } from './packem_shared/SPACE_MONO-VdlYcTli.mjs';
|
|
3
|
-
|
|
4
|
-
const CHROME_CHROMIUM_RE = /\b(Chrome|Chromium)\//;
|
|
5
|
-
const isColorSupported$1 = () => (() => {
|
|
6
|
-
if (typeof navigator !== "undefined") {
|
|
7
|
-
if (navigator.userAgentData) {
|
|
8
|
-
const brand = navigator.userAgentData.brands.find(({ b }) => b === "Chromium");
|
|
9
|
-
if (brand?.version > 93) {
|
|
10
|
-
return SPACE_TRUE_COLORS;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
if (CHROME_CHROMIUM_RE.test(navigator.userAgent)) {
|
|
14
|
-
return SPACE_16_COLORS;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return SPACE_MONO;
|
|
18
|
-
})();
|
|
19
|
-
const isStdoutColorSupported$1 = isColorSupported$1;
|
|
20
|
-
|
|
21
|
-
const isColorSupported = () => (() => {
|
|
22
|
-
if (process.env.NEXT_RUNTIME?.includes("edge")) {
|
|
23
|
-
return SPACE_16_COLORS;
|
|
24
|
-
}
|
|
25
|
-
return isStdoutColorSupported$1();
|
|
26
|
-
})();
|
|
27
|
-
const isStdoutColorSupported = isColorSupported;
|
|
28
|
-
const isStderrColorSupported = isColorSupported;
|
|
29
|
-
|
|
30
|
-
export { SPACE_16_COLORS, SPACE_MONO, SPACE_TRUE_COLORS, isStderrColorSupported, isStdoutColorSupported };
|
|
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 _}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=/\b(Chrome|Chromium)\//,C=p(()=>(()=>{if(typeof navigator<"u"){if(navigator.userAgentData){const r=navigator.userAgentData.brands.find(({brand:e})=>e==="Chromium");if(Number(r?.version)>93)return i}if(d.test(navigator.userAgent))return t}return u})(),"isColorSupported"),S=C;var f=Object.defineProperty,v=o((r,e)=>f(r,"name",{value:e,configurable:!0}),"o");const n=v(()=>process.env.NEXT_RUNTIME?.includes("edge")?t:S(),"isColorSupported"),g=n,l=n;export{t as SPACE_16_COLORS,_ as SPACE_256_COLORS,u as SPACE_MONO,i as SPACE_TRUE_COLORS,l as isStderrColorSupported,g as isStdoutColorSupported};
|
|
@@ -1,145 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
-
|
|
5
|
-
const SPACE_MONO = require('./packem_shared/SPACE_MONO-Cwv43lY6.cjs');
|
|
6
|
-
|
|
7
|
-
const NO_COLOR_FLAGS_RE = /^-{1,2}(no-color|no-colors|color=false|color=never)$/;
|
|
8
|
-
const COLOR_256_FLAGS_RE = /^-{1,2}(color=256)$/;
|
|
9
|
-
const COLOR_TRUECOLOR_FLAGS_RE = /^-{1,2}(color=16m|color=full|color=truecolor)$/;
|
|
10
|
-
const COLOR_ENABLED_FLAGS_RE = /^-{1,2}(color|colors|color=true|color=always)$/;
|
|
11
|
-
const DUMB_TERM_RE = /-mono|dumb/i;
|
|
12
|
-
const TEAMCITY_RE = /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/;
|
|
13
|
-
const TERM_256_RE = /-256(color)?$/i;
|
|
14
|
-
const TERM_COLOR_RE = /^screen|^tmux|^xterm|^vt[1-5]\d\d|^ansi|color|mintty|rxvt|cygwin|linux/i;
|
|
15
|
-
const isColorSupportedFactory = (stdName) => {
|
|
16
|
-
const _this = globalThis;
|
|
17
|
-
const isDeno = _this.Deno != void 0;
|
|
18
|
-
const proc = _this.process ?? _this.Deno ?? {};
|
|
19
|
-
const argv = proc.argv ?? proc.args ?? [];
|
|
20
|
-
const oneOfFlags = (regex) => {
|
|
21
|
-
const terminatorPosition = argv.indexOf("--");
|
|
22
|
-
const position = argv.findIndex((flag) => regex.test(flag));
|
|
23
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
24
|
-
};
|
|
25
|
-
let environment = {};
|
|
26
|
-
try {
|
|
27
|
-
environment = isDeno ? proc.env.toObject() : proc.env ?? {};
|
|
28
|
-
} catch {
|
|
29
|
-
}
|
|
30
|
-
const FORCE_COLOR = "FORCE_COLOR";
|
|
31
|
-
const hasForceColor = FORCE_COLOR in environment;
|
|
32
|
-
const forceColorValue = environment[FORCE_COLOR] ?? void 0;
|
|
33
|
-
const forceColorValueIsString = Object.prototype.toString.call(forceColorValue).slice(8, -1) === "String";
|
|
34
|
-
const forceColorValueIsNumber = typeof forceColorValue === "number";
|
|
35
|
-
let forceColor;
|
|
36
|
-
if (forceColorValue === "true") {
|
|
37
|
-
forceColor = SPACE_MONO.SPACE_16_COLORS;
|
|
38
|
-
} else if (forceColorValue === "false") {
|
|
39
|
-
forceColor = SPACE_MONO.SPACE_MONO;
|
|
40
|
-
} else if (forceColorValueIsString && forceColorValue.length === 0) {
|
|
41
|
-
forceColor = SPACE_MONO.SPACE_16_COLORS;
|
|
42
|
-
} else if (forceColorValueIsString && forceColorValue.length > 0) {
|
|
43
|
-
forceColor = Math.min(Number.parseInt(forceColorValue, 10), 3);
|
|
44
|
-
} else if (forceColorValueIsNumber) {
|
|
45
|
-
forceColor = Math.min(forceColorValue, 3);
|
|
46
|
-
}
|
|
47
|
-
if (forceColorValue !== "true" && forceColorValue !== "false" && forceColor !== void 0 && forceColor < 4) {
|
|
48
|
-
return forceColor;
|
|
49
|
-
}
|
|
50
|
-
const isForceDisabled = "NO_COLOR" in environment || hasForceColor && forceColor === 0 || oneOfFlags(NO_COLOR_FLAGS_RE);
|
|
51
|
-
if (isForceDisabled) {
|
|
52
|
-
return SPACE_MONO.SPACE_MONO;
|
|
53
|
-
}
|
|
54
|
-
if (oneOfFlags(COLOR_256_FLAGS_RE)) {
|
|
55
|
-
return SPACE_MONO.SPACE_256_COLORS;
|
|
56
|
-
}
|
|
57
|
-
if (oneOfFlags(COLOR_TRUECOLOR_FLAGS_RE)) {
|
|
58
|
-
return SPACE_MONO.SPACE_TRUE_COLORS;
|
|
59
|
-
}
|
|
60
|
-
const isForceEnabled = oneOfFlags(COLOR_ENABLED_FLAGS_RE);
|
|
61
|
-
if (isForceEnabled) {
|
|
62
|
-
return SPACE_MONO.SPACE_16_COLORS;
|
|
63
|
-
}
|
|
64
|
-
const minColorLevel = forceColor ?? SPACE_MONO.SPACE_MONO;
|
|
65
|
-
if ("TF_BUILD" in environment && "AGENT_NAME" in environment) {
|
|
66
|
-
return SPACE_MONO.SPACE_16_COLORS;
|
|
67
|
-
}
|
|
68
|
-
const isDumbTerminal = environment.TERM && DUMB_TERM_RE.test(environment.TERM);
|
|
69
|
-
if (isDumbTerminal) {
|
|
70
|
-
return minColorLevel;
|
|
71
|
-
}
|
|
72
|
-
if ((isDeno ? _this.Deno.build.os : proc.platform) === "win32") {
|
|
73
|
-
try {
|
|
74
|
-
const osRelease = (isDeno ? _this.Deno.osRelease() : proc.os.release()).split(".");
|
|
75
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
76
|
-
return Number(osRelease[2]) >= 14931 ? SPACE_MONO.SPACE_TRUE_COLORS : SPACE_MONO.SPACE_256_COLORS;
|
|
77
|
-
}
|
|
78
|
-
return SPACE_MONO.SPACE_16_COLORS;
|
|
79
|
-
} catch {
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
if ("CI" in environment) {
|
|
83
|
-
if (["GITEA_ACTIONS", "CIRCLECI", "GITHUB_WORKFLOW", "GITHUB_ACTIONS"].some((sign) => sign in environment)) {
|
|
84
|
-
return SPACE_MONO.SPACE_TRUE_COLORS;
|
|
85
|
-
}
|
|
86
|
-
if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in environment) || environment.CI_NAME === "codeship") {
|
|
87
|
-
return SPACE_MONO.SPACE_16_COLORS;
|
|
88
|
-
}
|
|
89
|
-
return minColorLevel;
|
|
90
|
-
}
|
|
91
|
-
if (environment.TERMINAL_EMULATOR?.includes("JediTerm")) {
|
|
92
|
-
return SPACE_MONO.SPACE_TRUE_COLORS;
|
|
93
|
-
}
|
|
94
|
-
if ("TEAMCITY_VERSION" in environment) {
|
|
95
|
-
return TEAMCITY_RE.test(environment.TEAMCITY_VERSION) ? SPACE_MONO.SPACE_16_COLORS : SPACE_MONO.SPACE_MONO;
|
|
96
|
-
}
|
|
97
|
-
if (environment.COLORTERM === "truecolor") {
|
|
98
|
-
return SPACE_MONO.SPACE_TRUE_COLORS;
|
|
99
|
-
}
|
|
100
|
-
if (environment.TERM === "xterm-kitty") {
|
|
101
|
-
return SPACE_MONO.SPACE_TRUE_COLORS;
|
|
102
|
-
}
|
|
103
|
-
if (environment.TERM === "xterm-ghostty") {
|
|
104
|
-
return SPACE_MONO.SPACE_TRUE_COLORS;
|
|
105
|
-
}
|
|
106
|
-
if (environment.TERM === "wezterm") {
|
|
107
|
-
return SPACE_MONO.SPACE_TRUE_COLORS;
|
|
108
|
-
}
|
|
109
|
-
if ("TERM_PROGRAM" in environment) {
|
|
110
|
-
const version = Number.parseInt((environment.TERM_PROGRAM_VERSION ?? "").split(".")[0], 10);
|
|
111
|
-
if (environment.TERM_PROGRAM === "iTerm.app") {
|
|
112
|
-
return version >= 3 ? SPACE_MONO.SPACE_TRUE_COLORS : SPACE_MONO.SPACE_256_COLORS;
|
|
113
|
-
}
|
|
114
|
-
if (environment.TERM_PROGRAM === "Apple_Terminal") {
|
|
115
|
-
return SPACE_MONO.SPACE_256_COLORS;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
if (TERM_256_RE.test(environment.TERM)) {
|
|
119
|
-
return SPACE_MONO.SPACE_256_COLORS;
|
|
120
|
-
}
|
|
121
|
-
let isTTY;
|
|
122
|
-
if (isDeno) {
|
|
123
|
-
isTTY = stdName === "out" ? _this.Deno.stdout.isTerminal() : _this.Deno.stderr.isTerminal();
|
|
124
|
-
} else if ("PM2_HOME" in environment && "pm_id" in environment) {
|
|
125
|
-
isTTY = true;
|
|
126
|
-
} else {
|
|
127
|
-
isTTY = proc[`std${stdName}`] && "isTTY" in proc[`std${stdName}`];
|
|
128
|
-
}
|
|
129
|
-
if (isTTY && TERM_COLOR_RE.test(environment.TERM)) {
|
|
130
|
-
return SPACE_MONO.SPACE_16_COLORS;
|
|
131
|
-
}
|
|
132
|
-
if ("COLORTERM" in environment) {
|
|
133
|
-
return SPACE_MONO.SPACE_16_COLORS;
|
|
134
|
-
}
|
|
135
|
-
return minColorLevel;
|
|
136
|
-
};
|
|
137
|
-
const isStdoutColorSupported = () => isColorSupportedFactory("out");
|
|
138
|
-
const isStderrColorSupported = () => isColorSupportedFactory("err");
|
|
139
|
-
|
|
140
|
-
exports.SPACE_16_COLORS = SPACE_MONO.SPACE_16_COLORS;
|
|
141
|
-
exports.SPACE_256_COLORS = SPACE_MONO.SPACE_256_COLORS;
|
|
142
|
-
exports.SPACE_MONO = SPACE_MONO.SPACE_MONO;
|
|
143
|
-
exports.SPACE_TRUE_COLORS = SPACE_MONO.SPACE_TRUE_COLORS;
|
|
144
|
-
exports.isStderrColorSupported = isStderrColorSupported;
|
|
145
|
-
exports.isStdoutColorSupported = isStdoutColorSupported;
|
|
1
|
+
"use strict";var f=Object.defineProperty;var c=(_,o)=>f(_,"name",{value:o,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./packem_shared/SPACE_MONO-CIFY-d7-.cjs");var p=Object.defineProperty,R=c((_,o)=>p(_,"name",{value:o,configurable:!0}),"u");const m=/^-{1,2}(no-color|no-colors|color=false|color=never)$/,N=/^-{1,2}(color=256)$/,I=/^-{1,2}(color=16m|color=full|color=truecolor)$/,b=/^-{1,2}(color|colors|color=true|color=always)$/,v=/-mono|dumb/i,U=/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/,g=/-256(color)?$/i,y=/^screen|^tmux|^xterm|^vt[1-5]\d\d|^ansi|color|mintty|rxvt|cygwin|linux/i,L=R(_=>{const o=globalThis,i=o.Deno!=null,C=o.process??o.Deno??{},s=C.argv??C.args??[],n=R(t=>{const T=s.indexOf("--"),P=s.findIndex(a=>t.test(a));return P!==-1&&(T===-1||P<T)},"oneOfFlags");let r={};try{r=i?C.env.toObject():C.env??{}}catch{}const u="FORCE_COLOR",d=u in r,O=r[u]??void 0,A=Object.prototype.toString.call(O).slice(8,-1)==="String",M=typeof O=="number";let S;if(O==="true")S=e.SPACE_16_COLORS;else if(O==="false")S=e.SPACE_MONO;else if(A&&O.length===0)S=e.SPACE_16_COLORS;else if(A&&O.length>0){const t=Number.parseInt(O,10);S=Number.isNaN(t)?void 0:Math.min(t,3)}else M&&(S=Number.isNaN(O)?void 0:Math.min(O,3));if(O!=="true"&&O!=="false"&&S!==void 0&&S<4)return S;if("NO_COLOR"in r||d&&S===0||n(m))return e.SPACE_MONO;if(n(N))return e.SPACE_256_COLORS;if(n(I))return e.SPACE_TRUE_COLORS;if(n(b))return e.SPACE_16_COLORS;const l=S??e.SPACE_MONO;if("TF_BUILD"in r&&"AGENT_NAME"in r)return e.SPACE_16_COLORS;if(r.TERM&&v.test(r.TERM))return l;if((i?o.Deno.build.os:C.platform)==="win32")try{const t=(i?o.Deno.osRelease():C.os.release()).split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?e.SPACE_TRUE_COLORS:e.SPACE_256_COLORS:e.SPACE_16_COLORS}catch{}if("CI"in r)return["GITEA_ACTIONS","CIRCLECI","GITHUB_WORKFLOW","GITHUB_ACTIONS"].some(t=>t in r)?e.SPACE_TRUE_COLORS:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(t=>t in r)||r.CI_NAME==="codeship"?e.SPACE_16_COLORS:l;if(r.TERMINAL_EMULATOR?.includes("JediTerm"))return e.SPACE_TRUE_COLORS;if("TEAMCITY_VERSION"in r)return U.test(r.TEAMCITY_VERSION)?e.SPACE_16_COLORS:e.SPACE_MONO;if(r.COLORTERM==="truecolor"||r.TERM==="xterm-kitty"||r.TERM==="xterm-ghostty"||r.TERM==="wezterm")return e.SPACE_TRUE_COLORS;if("TERM_PROGRAM"in r){const t=Number.parseInt((r.TERM_PROGRAM_VERSION??"").split(".")[0],10);if(r.TERM_PROGRAM==="iTerm.app")return t>=3?e.SPACE_TRUE_COLORS:e.SPACE_256_COLORS;if(r.TERM_PROGRAM==="Apple_Terminal")return e.SPACE_256_COLORS}if(g.test(r.TERM))return e.SPACE_256_COLORS;let E;return i?E=_==="out"?o.Deno.stdout.isTerminal():o.Deno.stderr.isTerminal():"PM2_HOME"in r&&"pm_id"in r?E=!0:E=!!C[`std${_}`]?.isTTY,E&&y.test(r.TERM)||"COLORTERM"in r?e.SPACE_16_COLORS:l},"isColorSupportedFactory"),D=R(()=>L("out"),"isStdoutColorSupported"),h=R(()=>L("err"),"isStderrColorSupported");exports.SPACE_16_COLORS=e.SPACE_16_COLORS;exports.SPACE_256_COLORS=e.SPACE_256_COLORS;exports.SPACE_MONO=e.SPACE_MONO;exports.SPACE_TRUE_COLORS=e.SPACE_TRUE_COLORS;exports.isStderrColorSupported=h;exports.isStdoutColorSupported=D;
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Levels:
|
|
3
|
+
* - `0` - All colors disabled.
|
|
4
|
+
* - `1` - Basic 16 colors support.
|
|
5
|
+
* - `2` - ANSI 256 colors support.
|
|
6
|
+
* - `3` - Truecolor 16 million colors support.
|
|
7
|
+
*/
|
|
8
|
+
type ColorSupportLevel = 0 | 1 | 2 | 3;
|
|
9
|
+
declare const SPACE_MONO = 0;
|
|
10
|
+
declare const SPACE_16_COLORS = 1;
|
|
11
|
+
declare const SPACE_256_COLORS = 2;
|
|
12
|
+
declare const SPACE_TRUE_COLORS = 3;
|
|
13
|
+
declare const isStdoutColorSupported: () => ColorSupportLevel;
|
|
14
|
+
declare const isStderrColorSupported: () => ColorSupportLevel;
|
|
15
|
+
export { type ColorSupportLevel, SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO, SPACE_TRUE_COLORS, isStderrColorSupported, isStdoutColorSupported };
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Levels:
|
|
3
|
+
* - `0` - All colors disabled.
|
|
4
|
+
* - `1` - Basic 16 colors support.
|
|
5
|
+
* - `2` - ANSI 256 colors support.
|
|
6
|
+
* - `3` - Truecolor 16 million colors support.
|
|
7
|
+
*/
|
|
8
|
+
type ColorSupportLevel = 0 | 1 | 2 | 3;
|
|
9
|
+
declare const SPACE_MONO = 0;
|
|
10
|
+
declare const SPACE_16_COLORS = 1;
|
|
11
|
+
declare const SPACE_256_COLORS = 2;
|
|
12
|
+
declare const SPACE_TRUE_COLORS = 3;
|
|
13
|
+
declare const isStdoutColorSupported: () => ColorSupportLevel;
|
|
14
|
+
declare const isStderrColorSupported: () => ColorSupportLevel;
|
|
15
|
+
export { type ColorSupportLevel, SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO, SPACE_TRUE_COLORS, isStderrColorSupported, isStdoutColorSupported };
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Levels:
|
|
3
|
+
* - `0` - All colors disabled.
|
|
4
|
+
* - `1` - Basic 16 colors support.
|
|
5
|
+
* - `2` - ANSI 256 colors support.
|
|
6
|
+
* - `3` - Truecolor 16 million colors support.
|
|
7
|
+
*/
|
|
8
|
+
type ColorSupportLevel = 0 | 1 | 2 | 3;
|
|
9
|
+
declare const SPACE_MONO = 0;
|
|
10
|
+
declare const SPACE_16_COLORS = 1;
|
|
11
|
+
declare const SPACE_256_COLORS = 2;
|
|
12
|
+
declare const SPACE_TRUE_COLORS = 3;
|
|
13
|
+
declare const isStdoutColorSupported: () => ColorSupportLevel;
|
|
14
|
+
declare const isStderrColorSupported: () => ColorSupportLevel;
|
|
15
|
+
export { type ColorSupportLevel, SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO, SPACE_TRUE_COLORS, isStderrColorSupported, isStdoutColorSupported };
|
|
@@ -1,136 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const NO_COLOR_FLAGS_RE = /^-{1,2}(no-color|no-colors|color=false|color=never)$/;
|
|
4
|
-
const COLOR_256_FLAGS_RE = /^-{1,2}(color=256)$/;
|
|
5
|
-
const COLOR_TRUECOLOR_FLAGS_RE = /^-{1,2}(color=16m|color=full|color=truecolor)$/;
|
|
6
|
-
const COLOR_ENABLED_FLAGS_RE = /^-{1,2}(color|colors|color=true|color=always)$/;
|
|
7
|
-
const DUMB_TERM_RE = /-mono|dumb/i;
|
|
8
|
-
const TEAMCITY_RE = /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/;
|
|
9
|
-
const TERM_256_RE = /-256(color)?$/i;
|
|
10
|
-
const TERM_COLOR_RE = /^screen|^tmux|^xterm|^vt[1-5]\d\d|^ansi|color|mintty|rxvt|cygwin|linux/i;
|
|
11
|
-
const isColorSupportedFactory = (stdName) => {
|
|
12
|
-
const _this = globalThis;
|
|
13
|
-
const isDeno = _this.Deno != void 0;
|
|
14
|
-
const proc = _this.process ?? _this.Deno ?? {};
|
|
15
|
-
const argv = proc.argv ?? proc.args ?? [];
|
|
16
|
-
const oneOfFlags = (regex) => {
|
|
17
|
-
const terminatorPosition = argv.indexOf("--");
|
|
18
|
-
const position = argv.findIndex((flag) => regex.test(flag));
|
|
19
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
20
|
-
};
|
|
21
|
-
let environment = {};
|
|
22
|
-
try {
|
|
23
|
-
environment = isDeno ? proc.env.toObject() : proc.env ?? {};
|
|
24
|
-
} catch {
|
|
25
|
-
}
|
|
26
|
-
const FORCE_COLOR = "FORCE_COLOR";
|
|
27
|
-
const hasForceColor = FORCE_COLOR in environment;
|
|
28
|
-
const forceColorValue = environment[FORCE_COLOR] ?? void 0;
|
|
29
|
-
const forceColorValueIsString = Object.prototype.toString.call(forceColorValue).slice(8, -1) === "String";
|
|
30
|
-
const forceColorValueIsNumber = typeof forceColorValue === "number";
|
|
31
|
-
let forceColor;
|
|
32
|
-
if (forceColorValue === "true") {
|
|
33
|
-
forceColor = SPACE_16_COLORS;
|
|
34
|
-
} else if (forceColorValue === "false") {
|
|
35
|
-
forceColor = SPACE_MONO;
|
|
36
|
-
} else if (forceColorValueIsString && forceColorValue.length === 0) {
|
|
37
|
-
forceColor = SPACE_16_COLORS;
|
|
38
|
-
} else if (forceColorValueIsString && forceColorValue.length > 0) {
|
|
39
|
-
forceColor = Math.min(Number.parseInt(forceColorValue, 10), 3);
|
|
40
|
-
} else if (forceColorValueIsNumber) {
|
|
41
|
-
forceColor = Math.min(forceColorValue, 3);
|
|
42
|
-
}
|
|
43
|
-
if (forceColorValue !== "true" && forceColorValue !== "false" && forceColor !== void 0 && forceColor < 4) {
|
|
44
|
-
return forceColor;
|
|
45
|
-
}
|
|
46
|
-
const isForceDisabled = "NO_COLOR" in environment || hasForceColor && forceColor === 0 || oneOfFlags(NO_COLOR_FLAGS_RE);
|
|
47
|
-
if (isForceDisabled) {
|
|
48
|
-
return SPACE_MONO;
|
|
49
|
-
}
|
|
50
|
-
if (oneOfFlags(COLOR_256_FLAGS_RE)) {
|
|
51
|
-
return SPACE_256_COLORS;
|
|
52
|
-
}
|
|
53
|
-
if (oneOfFlags(COLOR_TRUECOLOR_FLAGS_RE)) {
|
|
54
|
-
return SPACE_TRUE_COLORS;
|
|
55
|
-
}
|
|
56
|
-
const isForceEnabled = oneOfFlags(COLOR_ENABLED_FLAGS_RE);
|
|
57
|
-
if (isForceEnabled) {
|
|
58
|
-
return SPACE_16_COLORS;
|
|
59
|
-
}
|
|
60
|
-
const minColorLevel = forceColor ?? SPACE_MONO;
|
|
61
|
-
if ("TF_BUILD" in environment && "AGENT_NAME" in environment) {
|
|
62
|
-
return SPACE_16_COLORS;
|
|
63
|
-
}
|
|
64
|
-
const isDumbTerminal = environment.TERM && DUMB_TERM_RE.test(environment.TERM);
|
|
65
|
-
if (isDumbTerminal) {
|
|
66
|
-
return minColorLevel;
|
|
67
|
-
}
|
|
68
|
-
if ((isDeno ? _this.Deno.build.os : proc.platform) === "win32") {
|
|
69
|
-
try {
|
|
70
|
-
const osRelease = (isDeno ? _this.Deno.osRelease() : proc.os.release()).split(".");
|
|
71
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
72
|
-
return Number(osRelease[2]) >= 14931 ? SPACE_TRUE_COLORS : SPACE_256_COLORS;
|
|
73
|
-
}
|
|
74
|
-
return SPACE_16_COLORS;
|
|
75
|
-
} catch {
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
if ("CI" in environment) {
|
|
79
|
-
if (["GITEA_ACTIONS", "CIRCLECI", "GITHUB_WORKFLOW", "GITHUB_ACTIONS"].some((sign) => sign in environment)) {
|
|
80
|
-
return SPACE_TRUE_COLORS;
|
|
81
|
-
}
|
|
82
|
-
if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in environment) || environment.CI_NAME === "codeship") {
|
|
83
|
-
return SPACE_16_COLORS;
|
|
84
|
-
}
|
|
85
|
-
return minColorLevel;
|
|
86
|
-
}
|
|
87
|
-
if (environment.TERMINAL_EMULATOR?.includes("JediTerm")) {
|
|
88
|
-
return SPACE_TRUE_COLORS;
|
|
89
|
-
}
|
|
90
|
-
if ("TEAMCITY_VERSION" in environment) {
|
|
91
|
-
return TEAMCITY_RE.test(environment.TEAMCITY_VERSION) ? SPACE_16_COLORS : SPACE_MONO;
|
|
92
|
-
}
|
|
93
|
-
if (environment.COLORTERM === "truecolor") {
|
|
94
|
-
return SPACE_TRUE_COLORS;
|
|
95
|
-
}
|
|
96
|
-
if (environment.TERM === "xterm-kitty") {
|
|
97
|
-
return SPACE_TRUE_COLORS;
|
|
98
|
-
}
|
|
99
|
-
if (environment.TERM === "xterm-ghostty") {
|
|
100
|
-
return SPACE_TRUE_COLORS;
|
|
101
|
-
}
|
|
102
|
-
if (environment.TERM === "wezterm") {
|
|
103
|
-
return SPACE_TRUE_COLORS;
|
|
104
|
-
}
|
|
105
|
-
if ("TERM_PROGRAM" in environment) {
|
|
106
|
-
const version = Number.parseInt((environment.TERM_PROGRAM_VERSION ?? "").split(".")[0], 10);
|
|
107
|
-
if (environment.TERM_PROGRAM === "iTerm.app") {
|
|
108
|
-
return version >= 3 ? SPACE_TRUE_COLORS : SPACE_256_COLORS;
|
|
109
|
-
}
|
|
110
|
-
if (environment.TERM_PROGRAM === "Apple_Terminal") {
|
|
111
|
-
return SPACE_256_COLORS;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
if (TERM_256_RE.test(environment.TERM)) {
|
|
115
|
-
return SPACE_256_COLORS;
|
|
116
|
-
}
|
|
117
|
-
let isTTY;
|
|
118
|
-
if (isDeno) {
|
|
119
|
-
isTTY = stdName === "out" ? _this.Deno.stdout.isTerminal() : _this.Deno.stderr.isTerminal();
|
|
120
|
-
} else if ("PM2_HOME" in environment && "pm_id" in environment) {
|
|
121
|
-
isTTY = true;
|
|
122
|
-
} else {
|
|
123
|
-
isTTY = proc[`std${stdName}`] && "isTTY" in proc[`std${stdName}`];
|
|
124
|
-
}
|
|
125
|
-
if (isTTY && TERM_COLOR_RE.test(environment.TERM)) {
|
|
126
|
-
return SPACE_16_COLORS;
|
|
127
|
-
}
|
|
128
|
-
if ("COLORTERM" in environment) {
|
|
129
|
-
return SPACE_16_COLORS;
|
|
130
|
-
}
|
|
131
|
-
return minColorLevel;
|
|
132
|
-
};
|
|
133
|
-
const isStdoutColorSupported = () => isColorSupportedFactory("out");
|
|
134
|
-
const isStderrColorSupported = () => isColorSupportedFactory("err");
|
|
135
|
-
|
|
136
|
-
export { SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO, SPACE_TRUE_COLORS, isStderrColorSupported, isStdoutColorSupported };
|
|
1
|
+
var b=Object.defineProperty;var _=(u,t)=>b(u,"name",{value:t,configurable:!0});import{SPACE_MONO as f,SPACE_256_COLORS as c,SPACE_TRUE_COLORS as i,SPACE_16_COLORS as l}from"./packem_shared/SPACE_MONO-BEQbKWNs.mjs";var L=Object.defineProperty,E=_((u,t)=>L(u,"name",{value:t,configurable:!0}),"u");const v=/^-{1,2}(no-color|no-colors|color=false|color=never)$/,P=/^-{1,2}(color=256)$/,g=/^-{1,2}(color=16m|color=full|color=truecolor)$/,y=/^-{1,2}(color|colors|color=true|color=always)$/,D=/-mono|dumb/i,h=/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/,x=/-256(color)?$/i,G=/^screen|^tmux|^xterm|^vt[1-5]\d\d|^ansi|color|mintty|rxvt|cygwin|linux/i,I=E(u=>{const t=globalThis,R=t.Deno!=null,s=t.process??t.Deno??{},m=s.argv??s.args??[],O=E(e=>{const M=m.indexOf("--"),C=m.findIndex(A=>e.test(A));return C!==-1&&(M===-1||C<M)},"oneOfFlags");let r={};try{r=R?s.env.toObject():s.env??{}}catch{}const d="FORCE_COLOR",S=d in r,o=r[d]??void 0,p=Object.prototype.toString.call(o).slice(8,-1)==="String",N=typeof o=="number";let n;if(o==="true")n=l;else if(o==="false")n=f;else if(p&&o.length===0)n=l;else if(p&&o.length>0){const e=Number.parseInt(o,10);n=Number.isNaN(e)?void 0:Math.min(e,3)}else N&&(n=Number.isNaN(o)?void 0:Math.min(o,3));if(o!=="true"&&o!=="false"&&n!==void 0&&n<4)return n;if("NO_COLOR"in r||S&&n===0||O(v))return f;if(O(P))return c;if(O(g))return i;if(O(y))return l;const a=n??f;if("TF_BUILD"in r&&"AGENT_NAME"in r)return l;if(r.TERM&&D.test(r.TERM))return a;if((R?t.Deno.build.os:s.platform)==="win32")try{const e=(R?t.Deno.osRelease():s.os.release()).split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?i:c:l}catch{}if("CI"in r)return["GITEA_ACTIONS","CIRCLECI","GITHUB_WORKFLOW","GITHUB_ACTIONS"].some(e=>e in r)?i:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(e=>e in r)||r.CI_NAME==="codeship"?l:a;if(r.TERMINAL_EMULATOR?.includes("JediTerm"))return i;if("TEAMCITY_VERSION"in r)return h.test(r.TEAMCITY_VERSION)?l:f;if(r.COLORTERM==="truecolor")return i;if(r.TERM==="xterm-kitty")return i;if(r.TERM==="xterm-ghostty")return i;if(r.TERM==="wezterm")return i;if("TERM_PROGRAM"in r){const e=Number.parseInt((r.TERM_PROGRAM_VERSION??"").split(".")[0],10);if(r.TERM_PROGRAM==="iTerm.app")return e>=3?i:c;if(r.TERM_PROGRAM==="Apple_Terminal")return c}if(x.test(r.TERM))return c;let T;return R?T=u==="out"?t.Deno.stdout.isTerminal():t.Deno.stderr.isTerminal():"PM2_HOME"in r&&"pm_id"in r?T=!0:T=!!s[`std${u}`]?.isTTY,T&&G.test(r.TERM)?l:"COLORTERM"in r?l:a},"isColorSupportedFactory"),$=E(()=>I("out"),"isStdoutColorSupported"),B=E(()=>I("err"),"isStderrColorSupported");export{l as SPACE_16_COLORS,c as SPACE_256_COLORS,f as SPACE_MONO,i as SPACE_TRUE_COLORS,B as isStderrColorSupported,$ as isStdoutColorSupported};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const O=0,C=1,S=2,_=3;export{C as SPACE_16_COLORS,S as SPACE_256_COLORS,O as SPACE_MONO,_ as SPACE_TRUE_COLORS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const O=0,S=1,_=2,C=3;exports.SPACE_16_COLORS=S;exports.SPACE_256_COLORS=_;exports.SPACE_MONO=O;exports.SPACE_TRUE_COLORS=C;
|
package/package.json
CHANGED
|
@@ -1,41 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/is-ansi-color-supported",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.12",
|
|
4
4
|
"description": "Detect whether a terminal or browser supports ansi colors.",
|
|
5
5
|
"keywords": [
|
|
6
|
+
"256",
|
|
7
|
+
"FORCE_COLOR",
|
|
8
|
+
"NO_COLOR",
|
|
6
9
|
"anolilab",
|
|
7
|
-
"visulima",
|
|
8
|
-
"colorize",
|
|
9
10
|
"ansi",
|
|
10
|
-
"
|
|
11
|
+
"ansi-colors",
|
|
12
|
+
"capability",
|
|
13
|
+
"cli",
|
|
11
14
|
"color",
|
|
15
|
+
"colorize",
|
|
12
16
|
"colors",
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"xterm",
|
|
17
|
+
"colour",
|
|
18
|
+
"command-line",
|
|
16
19
|
"console",
|
|
17
|
-
"cli",
|
|
18
|
-
"truecolor",
|
|
19
|
-
"FORCE_COLOR",
|
|
20
|
-
"NO_COLOR",
|
|
21
|
-
"ansi-colors",
|
|
22
|
-
"style",
|
|
23
|
-
"tty",
|
|
24
|
-
"256",
|
|
25
20
|
"detect",
|
|
26
21
|
"edge",
|
|
27
22
|
"next.js",
|
|
28
23
|
"nextjs",
|
|
24
|
+
"shell",
|
|
25
|
+
"style",
|
|
26
|
+
"styles",
|
|
29
27
|
"support",
|
|
30
28
|
"supports",
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
29
|
+
"terminal",
|
|
30
|
+
"truecolor",
|
|
31
|
+
"tty",
|
|
32
|
+
"visulima",
|
|
33
|
+
"xterm"
|
|
34
34
|
],
|
|
35
35
|
"homepage": "https://visulima.com/packages/is-ansi-color-supported/",
|
|
36
|
-
"bugs":
|
|
37
|
-
"url": "https://github.com/visulima/visulima/issues"
|
|
38
|
-
},
|
|
36
|
+
"bugs": "https://github.com/visulima/visulima/issues",
|
|
39
37
|
"repository": {
|
|
40
38
|
"type": "git",
|
|
41
39
|
"url": "git+https://github.com/visulima/visulima.git",
|
|
@@ -60,14 +58,6 @@
|
|
|
60
58
|
"type": "module",
|
|
61
59
|
"exports": {
|
|
62
60
|
".": {
|
|
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
|
-
},
|
|
71
61
|
"import": {
|
|
72
62
|
"types": "./dist/is-color-supported.server.d.mts",
|
|
73
63
|
"default": "./dist/is-color-supported.server.mjs"
|
|
@@ -75,6 +65,14 @@
|
|
|
75
65
|
"require": {
|
|
76
66
|
"types": "./dist/is-color-supported.server.d.cts",
|
|
77
67
|
"default": "./dist/is-color-supported.server.cjs"
|
|
68
|
+
},
|
|
69
|
+
"edge-light": {
|
|
70
|
+
"types": "./dist/is-color-supported.edge-light.d.mts",
|
|
71
|
+
"default": "./dist/is-color-supported.edge-light.mjs"
|
|
72
|
+
},
|
|
73
|
+
"browser": {
|
|
74
|
+
"types": "./dist/is-color-supported.browser.d.mts",
|
|
75
|
+
"default": "./dist/is-color-supported.browser.mjs"
|
|
78
76
|
}
|
|
79
77
|
},
|
|
80
78
|
"./browser": {
|
|
@@ -106,9 +104,9 @@
|
|
|
106
104
|
"typesVersions": {
|
|
107
105
|
">=5.0": {
|
|
108
106
|
".": [
|
|
107
|
+
"./dist/is-color-supported.server.d.ts",
|
|
109
108
|
"./dist/is-color-supported.edge-light.d.ts",
|
|
110
|
-
"./dist/is-color-supported.browser.d.ts"
|
|
111
|
-
"./dist/is-color-supported.server.d.ts"
|
|
109
|
+
"./dist/is-color-supported.browser.d.ts"
|
|
112
110
|
],
|
|
113
111
|
"edge-light": [
|
|
114
112
|
"./dist/is-color-supported.edge-light.d.ts"
|
package/dist/color-spaces.d.cts
DELETED
package/dist/color-spaces.d.mts
DELETED
package/dist/color-spaces.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
-
|
|
5
|
-
const SPACE_MONO = 0;
|
|
6
|
-
const SPACE_16_COLORS = 1;
|
|
7
|
-
const SPACE_256_COLORS = 2;
|
|
8
|
-
const SPACE_TRUE_COLORS = 3;
|
|
9
|
-
|
|
10
|
-
exports.SPACE_16_COLORS = SPACE_16_COLORS;
|
|
11
|
-
exports.SPACE_256_COLORS = SPACE_256_COLORS;
|
|
12
|
-
exports.SPACE_MONO = SPACE_MONO;
|
|
13
|
-
exports.SPACE_TRUE_COLORS = SPACE_TRUE_COLORS;
|
package/dist/types.d.cts
DELETED
package/dist/types.d.mts
DELETED