@jsenv/core 39.0.1 → 39.0.3

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.
Files changed (2) hide show
  1. package/dist/jsenv_core.js +29 -9
  2. package/package.json +13 -11
@@ -811,19 +811,35 @@ const createAnsi = ({ supported }) => {
811
811
  MAGENTA: "\x1b[35m",
812
812
  CYAN: "\x1b[36m",
813
813
  GREY: "\x1b[90m",
814
- color: (text, ANSI_COLOR) => {
815
- return ANSI.supported && ANSI_COLOR
816
- ? `${ANSI_COLOR}${text}${RESET}`
817
- : text;
814
+ color: (text, color) => {
815
+ if (!ANSI.supported) {
816
+ return text;
817
+ }
818
+ if (!color) {
819
+ return text;
820
+ }
821
+ if (text.trim() === "") {
822
+ // cannot set color of blank chars
823
+ return text;
824
+ }
825
+ return `${color}${text}${RESET}`;
818
826
  },
819
827
 
820
828
  BOLD: "\x1b[1m",
821
829
  UNDERLINE: "\x1b[4m",
822
830
  STRIKE: "\x1b[9m",
823
- effect: (text, ANSI_EFFECT) => {
824
- return ANSI.supported && ANSI_EFFECT
825
- ? `${ANSI_EFFECT}${text}${RESET}`
826
- : text;
831
+ effect: (text, effect) => {
832
+ if (!ANSI.supported) {
833
+ return text;
834
+ }
835
+ if (!effect) {
836
+ return text;
837
+ }
838
+ // cannot add effect to empty string
839
+ if (text === "") {
840
+ return text;
841
+ }
842
+ return `${effect}${text}${RESET}`;
827
843
  },
828
844
  };
829
845
 
@@ -834,6 +850,7 @@ const processSupportsBasicColor = createSupportsColor(process.stdout).hasBasic;
834
850
 
835
851
  const ANSI = createAnsi({
836
852
  supported:
853
+ process.env.FORCE_COLOR === "1" ||
837
854
  processSupportsBasicColor ||
838
855
  // GitHub workflow does support ANSI but "supports-color" returns false
839
856
  // because stream.isTTY returns false, see https://github.com/actions/runner/issues/241
@@ -881,6 +898,9 @@ const createUnicode = ({ supported, ANSI }) => {
881
898
  get CIRCLE_CROSS_RAW() {
882
899
  return UNICODE.supported ? `ⓧ` : `(×)`;
883
900
  },
901
+ get CIRCLE_DOTTED_RAW() {
902
+ return UNICODE.supported ? `◌` : `*`;
903
+ },
884
904
  get COMMAND() {
885
905
  return ANSI.color(UNICODE.COMMAND_RAW, ANSI.GREY); // ANSI_MAGENTA)
886
906
  },
@@ -910,7 +930,7 @@ const createUnicode = ({ supported, ANSI }) => {
910
930
  };
911
931
 
912
932
  const UNICODE = createUnicode({
913
- supported: isUnicodeSupported() || process.env.FORCE_UNICODE === "1",
933
+ supported: process.env.FORCE_UNICODE === "1" || isUnicodeSupported(),
914
934
  ANSI,
915
935
  });
916
936
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/core",
3
- "version": "39.0.1",
3
+ "version": "39.0.3",
4
4
  "description": "Tool to develop, test and build js projects",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -48,6 +48,8 @@
48
48
  "dev": "node --conditions=development ./scripts/dev/dev.mjs",
49
49
  "test": "node --conditions=development ./scripts/test/test.mjs",
50
50
  "test:workspace": "npm run test --workspaces --if-present -- --workspace",
51
+ "test:ci": "CI=1 npm run test",
52
+ "test:workspace:ci": "CI=1 npm run test:workspace",
51
53
  "test:only_dev_server_errors": "node --conditions=development ./tests/dev_server/errors/dev_errors_snapshots.test.mjs",
52
54
  "build": "node --conditions=development ./scripts/build/build.mjs",
53
55
  "build:file_size": "node ./scripts/build/build_file_size.mjs --log",
@@ -64,22 +66,22 @@
64
66
  "dependencies": {
65
67
  "@financial-times/polyfill-useragent-normaliser": "1.10.2",
66
68
  "@jsenv/abort": "4.3.0",
67
- "@jsenv/ast": "6.1.1",
68
- "@jsenv/filesystem": "4.7.2",
69
- "@jsenv/humanize": "1.1.3",
69
+ "@jsenv/ast": "6.1.3",
70
+ "@jsenv/filesystem": "4.7.4",
71
+ "@jsenv/humanize": "1.2.1",
70
72
  "@jsenv/importmap": "1.2.1",
71
73
  "@jsenv/integrity": "0.0.2",
72
- "@jsenv/js-module-fallback": "1.3.18",
74
+ "@jsenv/js-module-fallback": "1.3.20",
73
75
  "@jsenv/node-esm-resolution": "1.0.2",
74
- "@jsenv/plugin-bundling": "2.6.12",
76
+ "@jsenv/plugin-bundling": "2.6.14",
75
77
  "@jsenv/plugin-minification": "1.5.4",
76
- "@jsenv/plugin-supervisor": "1.4.13",
77
- "@jsenv/plugin-transpilation": "1.4.1",
78
+ "@jsenv/plugin-supervisor": "1.4.15",
79
+ "@jsenv/plugin-transpilation": "1.4.3",
78
80
  "@jsenv/runtime-compat": "1.3.0",
79
- "@jsenv/server": "15.2.9",
80
- "@jsenv/sourcemap": "1.2.10",
81
+ "@jsenv/server": "15.2.11",
82
+ "@jsenv/sourcemap": "1.2.12",
81
83
  "@jsenv/url-meta": "8.4.2",
82
- "@jsenv/urls": "2.2.7",
84
+ "@jsenv/urls": "2.2.9",
83
85
  "@jsenv/utils": "2.1.1"
84
86
  },
85
87
  "devDependencies": {