vite 5.1.5 → 5.2.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +6 -0
- package/dist/client/client.mjs +23 -22
- package/dist/client/client.mjs.map +1 -1
- package/dist/node/chunks/{dep-WMYkPWs9.js → dep-6MdzGidO.js} +145 -145
- package/dist/node/chunks/{dep-G-px366b.js → dep-BxRAmRCV.js} +1153 -992
- package/dist/node/chunks/{dep-OHeF5w5D.js → dep-DeEXZBZL.js} +2 -2
- package/dist/node/cli.js +6 -6
- package/dist/node/index.d.ts +6 -5
- package/dist/node/index.js +3 -3
- package/dist/node/runtime.d.ts +2 -2
- package/dist/node/runtime.js +49 -43
- package/dist/node/{types.d-AKzkD8vd.d.ts → types.d-aGj9QkWt.d.ts} +19 -16
- package/dist/node-cjs/publicUtils.cjs +410 -407
- package/package.json +10 -9
- /package/dist/node/chunks/{dep-kjUoH5nk.js → dep-CrWVpuYf.js} +0 -0
- /package/dist/node/chunks/{dep-8a-6Quh6.js → dep-IQS-Za7F.js} +0 -0
@@ -185,7 +185,7 @@ var colors = /*@__PURE__*/getDefaultExportFromCjs(picocolorsExports);
|
|
185
185
|
|
186
186
|
var src = {exports: {}};
|
187
187
|
|
188
|
-
var
|
188
|
+
var browser$1 = {exports: {}};
|
189
189
|
|
190
190
|
/**
|
191
191
|
* Helpers.
|
@@ -640,207 +640,201 @@ function requireCommon () {
|
|
640
640
|
return common;
|
641
641
|
}
|
642
642
|
|
643
|
-
|
644
|
-
* Module dependencies.
|
645
|
-
*/
|
643
|
+
/* eslint-env browser */
|
646
644
|
|
647
|
-
var
|
645
|
+
var hasRequiredBrowser;
|
648
646
|
|
649
|
-
function
|
650
|
-
if (
|
651
|
-
|
647
|
+
function requireBrowser () {
|
648
|
+
if (hasRequiredBrowser) return browser$1.exports;
|
649
|
+
hasRequiredBrowser = 1;
|
652
650
|
(function (module, exports) {
|
653
|
-
const tty = require$$0;
|
654
|
-
const util = require$$1;
|
655
|
-
|
656
651
|
/**
|
657
|
-
* This is the
|
652
|
+
* This is the web browser implementation of `debug()`.
|
658
653
|
*/
|
659
654
|
|
660
|
-
exports.init = init;
|
661
|
-
exports.log = log;
|
662
655
|
exports.formatArgs = formatArgs;
|
663
656
|
exports.save = save;
|
664
657
|
exports.load = load;
|
665
658
|
exports.useColors = useColors;
|
666
|
-
exports.
|
667
|
-
|
668
|
-
|
669
|
-
|
659
|
+
exports.storage = localstorage();
|
660
|
+
exports.destroy = (() => {
|
661
|
+
let warned = false;
|
662
|
+
|
663
|
+
return () => {
|
664
|
+
if (!warned) {
|
665
|
+
warned = true;
|
666
|
+
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
667
|
+
}
|
668
|
+
};
|
669
|
+
})();
|
670
670
|
|
671
671
|
/**
|
672
672
|
* Colors.
|
673
673
|
*/
|
674
674
|
|
675
|
-
exports.colors = [
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
207,
|
754
|
-
208,
|
755
|
-
209,
|
756
|
-
214,
|
757
|
-
215,
|
758
|
-
220,
|
759
|
-
221
|
760
|
-
];
|
761
|
-
}
|
762
|
-
} catch (error) {
|
763
|
-
// Swallow - we only care if `supports-color` is available; it doesn't have to be.
|
764
|
-
}
|
675
|
+
exports.colors = [
|
676
|
+
'#0000CC',
|
677
|
+
'#0000FF',
|
678
|
+
'#0033CC',
|
679
|
+
'#0033FF',
|
680
|
+
'#0066CC',
|
681
|
+
'#0066FF',
|
682
|
+
'#0099CC',
|
683
|
+
'#0099FF',
|
684
|
+
'#00CC00',
|
685
|
+
'#00CC33',
|
686
|
+
'#00CC66',
|
687
|
+
'#00CC99',
|
688
|
+
'#00CCCC',
|
689
|
+
'#00CCFF',
|
690
|
+
'#3300CC',
|
691
|
+
'#3300FF',
|
692
|
+
'#3333CC',
|
693
|
+
'#3333FF',
|
694
|
+
'#3366CC',
|
695
|
+
'#3366FF',
|
696
|
+
'#3399CC',
|
697
|
+
'#3399FF',
|
698
|
+
'#33CC00',
|
699
|
+
'#33CC33',
|
700
|
+
'#33CC66',
|
701
|
+
'#33CC99',
|
702
|
+
'#33CCCC',
|
703
|
+
'#33CCFF',
|
704
|
+
'#6600CC',
|
705
|
+
'#6600FF',
|
706
|
+
'#6633CC',
|
707
|
+
'#6633FF',
|
708
|
+
'#66CC00',
|
709
|
+
'#66CC33',
|
710
|
+
'#9900CC',
|
711
|
+
'#9900FF',
|
712
|
+
'#9933CC',
|
713
|
+
'#9933FF',
|
714
|
+
'#99CC00',
|
715
|
+
'#99CC33',
|
716
|
+
'#CC0000',
|
717
|
+
'#CC0033',
|
718
|
+
'#CC0066',
|
719
|
+
'#CC0099',
|
720
|
+
'#CC00CC',
|
721
|
+
'#CC00FF',
|
722
|
+
'#CC3300',
|
723
|
+
'#CC3333',
|
724
|
+
'#CC3366',
|
725
|
+
'#CC3399',
|
726
|
+
'#CC33CC',
|
727
|
+
'#CC33FF',
|
728
|
+
'#CC6600',
|
729
|
+
'#CC6633',
|
730
|
+
'#CC9900',
|
731
|
+
'#CC9933',
|
732
|
+
'#CCCC00',
|
733
|
+
'#CCCC33',
|
734
|
+
'#FF0000',
|
735
|
+
'#FF0033',
|
736
|
+
'#FF0066',
|
737
|
+
'#FF0099',
|
738
|
+
'#FF00CC',
|
739
|
+
'#FF00FF',
|
740
|
+
'#FF3300',
|
741
|
+
'#FF3333',
|
742
|
+
'#FF3366',
|
743
|
+
'#FF3399',
|
744
|
+
'#FF33CC',
|
745
|
+
'#FF33FF',
|
746
|
+
'#FF6600',
|
747
|
+
'#FF6633',
|
748
|
+
'#FF9900',
|
749
|
+
'#FF9933',
|
750
|
+
'#FFCC00',
|
751
|
+
'#FFCC33'
|
752
|
+
];
|
765
753
|
|
766
754
|
/**
|
767
|
-
*
|
755
|
+
* Currently only WebKit-based Web Inspectors, Firefox >= v31,
|
756
|
+
* and the Firebug extension (any Firefox version) are known
|
757
|
+
* to support "%c" CSS customizations.
|
768
758
|
*
|
769
|
-
*
|
759
|
+
* TODO: add a `localStorage` variable to explicitly enable/disable colors
|
770
760
|
*/
|
771
761
|
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
//
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
return k.toUpperCase();
|
781
|
-
});
|
762
|
+
// eslint-disable-next-line complexity
|
763
|
+
function useColors() {
|
764
|
+
// NB: In an Electron preload script, document will be defined but not fully
|
765
|
+
// initialized. Since we know we're in Chrome, we'll just detect this case
|
766
|
+
// explicitly
|
767
|
+
if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
|
768
|
+
return true;
|
769
|
+
}
|
782
770
|
|
783
|
-
//
|
784
|
-
|
785
|
-
|
786
|
-
val = true;
|
787
|
-
} else if (/^(no|off|false|disabled)$/i.test(val)) {
|
788
|
-
val = false;
|
789
|
-
} else if (val === 'null') {
|
790
|
-
val = null;
|
791
|
-
} else {
|
792
|
-
val = Number(val);
|
771
|
+
// Internet Explorer and Edge do not support colors.
|
772
|
+
if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
773
|
+
return false;
|
793
774
|
}
|
794
775
|
|
795
|
-
|
796
|
-
|
797
|
-
|
776
|
+
// Is webkit? http://stackoverflow.com/a/16459606/376773
|
777
|
+
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
778
|
+
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
|
779
|
+
// Is firebug? http://stackoverflow.com/a/398120/376773
|
780
|
+
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
|
781
|
+
// Is firefox >= v31?
|
782
|
+
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
783
|
+
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
|
784
|
+
// Double check webkit in userAgent just in case we are in a worker
|
785
|
+
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
|
786
|
+
}
|
798
787
|
|
799
788
|
/**
|
800
|
-
*
|
801
|
-
*/
|
802
|
-
|
803
|
-
function useColors() {
|
804
|
-
return 'colors' in exports.inspectOpts ?
|
805
|
-
Boolean(exports.inspectOpts.colors) :
|
806
|
-
tty.isatty(process.stderr.fd);
|
807
|
-
}
|
808
|
-
|
809
|
-
/**
|
810
|
-
* Adds ANSI color escape codes if enabled.
|
789
|
+
* Colorize log arguments if enabled.
|
811
790
|
*
|
812
791
|
* @api public
|
813
792
|
*/
|
814
793
|
|
815
794
|
function formatArgs(args) {
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
795
|
+
args[0] = (this.useColors ? '%c' : '') +
|
796
|
+
this.namespace +
|
797
|
+
(this.useColors ? ' %c' : ' ') +
|
798
|
+
args[0] +
|
799
|
+
(this.useColors ? '%c ' : ' ') +
|
800
|
+
'+' + module.exports.humanize(this.diff);
|
822
801
|
|
823
|
-
|
824
|
-
|
825
|
-
} else {
|
826
|
-
args[0] = getDate() + name + ' ' + args[0];
|
802
|
+
if (!this.useColors) {
|
803
|
+
return;
|
827
804
|
}
|
828
|
-
}
|
829
805
|
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
806
|
+
const c = 'color: ' + this.color;
|
807
|
+
args.splice(1, 0, c, 'color: inherit');
|
808
|
+
|
809
|
+
// The final "%c" is somewhat tricky, because there could be other
|
810
|
+
// arguments passed either before or after the %c, so we need to
|
811
|
+
// figure out the correct index to insert the CSS into
|
812
|
+
let index = 0;
|
813
|
+
let lastC = 0;
|
814
|
+
args[0].replace(/%[a-zA-Z%]/g, match => {
|
815
|
+
if (match === '%%') {
|
816
|
+
return;
|
817
|
+
}
|
818
|
+
index++;
|
819
|
+
if (match === '%c') {
|
820
|
+
// We only are interested in the *last* %c
|
821
|
+
// (the user may have provided their own)
|
822
|
+
lastC = index;
|
823
|
+
}
|
824
|
+
});
|
825
|
+
|
826
|
+
args.splice(lastC, 0, c);
|
835
827
|
}
|
836
828
|
|
837
829
|
/**
|
838
|
-
* Invokes `
|
830
|
+
* Invokes `console.debug()` when available.
|
831
|
+
* No-op when `console.debug` is not a "function".
|
832
|
+
* If `console.debug` is not available, falls back
|
833
|
+
* to `console.log`.
|
834
|
+
*
|
835
|
+
* @api public
|
839
836
|
*/
|
840
|
-
|
841
|
-
function log(...args) {
|
842
|
-
return process.stderr.write(util.format(...args) + '\n');
|
843
|
-
}
|
837
|
+
exports.log = console.debug || console.log || (() => {});
|
844
838
|
|
845
839
|
/**
|
846
840
|
* Save `namespaces`.
|
@@ -849,12 +843,15 @@ function requireNode () {
|
|
849
843
|
* @api private
|
850
844
|
*/
|
851
845
|
function save(namespaces) {
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
846
|
+
try {
|
847
|
+
if (namespaces) {
|
848
|
+
exports.storage.setItem('debug', namespaces);
|
849
|
+
} else {
|
850
|
+
exports.storage.removeItem('debug');
|
851
|
+
}
|
852
|
+
} catch (error) {
|
853
|
+
// Swallow
|
854
|
+
// XXX (@Qix-) should we be logging these?
|
858
855
|
}
|
859
856
|
}
|
860
857
|
|
@@ -864,24 +861,42 @@ function requireNode () {
|
|
864
861
|
* @return {String} returns the previously persisted debug modes
|
865
862
|
* @api private
|
866
863
|
*/
|
867
|
-
|
868
864
|
function load() {
|
869
|
-
|
865
|
+
let r;
|
866
|
+
try {
|
867
|
+
r = exports.storage.getItem('debug');
|
868
|
+
} catch (error) {
|
869
|
+
// Swallow
|
870
|
+
// XXX (@Qix-) should we be logging these?
|
871
|
+
}
|
872
|
+
|
873
|
+
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
|
874
|
+
if (!r && typeof process !== 'undefined' && 'env' in process) {
|
875
|
+
r = process.env.DEBUG;
|
876
|
+
}
|
877
|
+
|
878
|
+
return r;
|
870
879
|
}
|
871
880
|
|
872
881
|
/**
|
873
|
-
*
|
882
|
+
* Localstorage attempts to return the localstorage.
|
874
883
|
*
|
875
|
-
*
|
876
|
-
*
|
884
|
+
* This is necessary because safari throws
|
885
|
+
* when a user disables cookies/localstorage
|
886
|
+
* and you attempt to access it.
|
887
|
+
*
|
888
|
+
* @return {LocalStorage}
|
889
|
+
* @api private
|
877
890
|
*/
|
878
891
|
|
879
|
-
function
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
892
|
+
function localstorage() {
|
893
|
+
try {
|
894
|
+
// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
|
895
|
+
// The Browser also has localStorage in the global context.
|
896
|
+
return localStorage;
|
897
|
+
} catch (error) {
|
898
|
+
// Swallow
|
899
|
+
// XXX (@Qix-) should we be logging these?
|
885
900
|
}
|
886
901
|
}
|
887
902
|
|
@@ -890,226 +905,223 @@ function requireNode () {
|
|
890
905
|
const {formatters} = module.exports;
|
891
906
|
|
892
907
|
/**
|
893
|
-
* Map %
|
894
|
-
*/
|
895
|
-
|
896
|
-
formatters.o = function (v) {
|
897
|
-
this.inspectOpts.colors = this.useColors;
|
898
|
-
return util.inspect(v, this.inspectOpts)
|
899
|
-
.split('\n')
|
900
|
-
.map(str => str.trim())
|
901
|
-
.join(' ');
|
902
|
-
};
|
903
|
-
|
904
|
-
/**
|
905
|
-
* Map %O to `util.inspect()`, allowing multiple lines if needed.
|
908
|
+
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
|
906
909
|
*/
|
907
910
|
|
908
|
-
formatters.
|
909
|
-
|
910
|
-
|
911
|
+
formatters.j = function (v) {
|
912
|
+
try {
|
913
|
+
return JSON.stringify(v);
|
914
|
+
} catch (error) {
|
915
|
+
return '[UnexpectedJSONParseError]: ' + error.message;
|
916
|
+
}
|
911
917
|
};
|
912
|
-
} (
|
913
|
-
return
|
918
|
+
} (browser$1, browser$1.exports));
|
919
|
+
return browser$1.exports;
|
914
920
|
}
|
915
921
|
|
916
|
-
var
|
922
|
+
var node = {exports: {}};
|
917
923
|
|
918
|
-
|
924
|
+
/**
|
925
|
+
* Module dependencies.
|
926
|
+
*/
|
919
927
|
|
920
|
-
var
|
928
|
+
var hasRequiredNode;
|
921
929
|
|
922
|
-
function
|
923
|
-
if (
|
924
|
-
|
930
|
+
function requireNode () {
|
931
|
+
if (hasRequiredNode) return node.exports;
|
932
|
+
hasRequiredNode = 1;
|
925
933
|
(function (module, exports) {
|
934
|
+
const tty = require$$0;
|
935
|
+
const util = require$$1;
|
936
|
+
|
926
937
|
/**
|
927
|
-
* This is the
|
938
|
+
* This is the Node.js implementation of `debug()`.
|
928
939
|
*/
|
929
940
|
|
941
|
+
exports.init = init;
|
942
|
+
exports.log = log;
|
930
943
|
exports.formatArgs = formatArgs;
|
931
944
|
exports.save = save;
|
932
945
|
exports.load = load;
|
933
946
|
exports.useColors = useColors;
|
934
|
-
exports.
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
return () => {
|
939
|
-
if (!warned) {
|
940
|
-
warned = true;
|
941
|
-
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
942
|
-
}
|
943
|
-
};
|
944
|
-
})();
|
947
|
+
exports.destroy = util.deprecate(
|
948
|
+
() => {},
|
949
|
+
'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
|
950
|
+
);
|
945
951
|
|
946
952
|
/**
|
947
953
|
* Colors.
|
948
954
|
*/
|
949
955
|
|
950
|
-
exports.colors = [
|
951
|
-
|
952
|
-
|
953
|
-
'
|
954
|
-
|
955
|
-
'
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
956
|
+
exports.colors = [6, 2, 3, 4, 5, 1];
|
957
|
+
|
958
|
+
try {
|
959
|
+
// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
|
960
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
961
|
+
const supportsColor = require('supports-color');
|
962
|
+
|
963
|
+
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
964
|
+
exports.colors = [
|
965
|
+
20,
|
966
|
+
21,
|
967
|
+
26,
|
968
|
+
27,
|
969
|
+
32,
|
970
|
+
33,
|
971
|
+
38,
|
972
|
+
39,
|
973
|
+
40,
|
974
|
+
41,
|
975
|
+
42,
|
976
|
+
43,
|
977
|
+
44,
|
978
|
+
45,
|
979
|
+
56,
|
980
|
+
57,
|
981
|
+
62,
|
982
|
+
63,
|
983
|
+
68,
|
984
|
+
69,
|
985
|
+
74,
|
986
|
+
75,
|
987
|
+
76,
|
988
|
+
77,
|
989
|
+
78,
|
990
|
+
79,
|
991
|
+
80,
|
992
|
+
81,
|
993
|
+
92,
|
994
|
+
93,
|
995
|
+
98,
|
996
|
+
99,
|
997
|
+
112,
|
998
|
+
113,
|
999
|
+
128,
|
1000
|
+
129,
|
1001
|
+
134,
|
1002
|
+
135,
|
1003
|
+
148,
|
1004
|
+
149,
|
1005
|
+
160,
|
1006
|
+
161,
|
1007
|
+
162,
|
1008
|
+
163,
|
1009
|
+
164,
|
1010
|
+
165,
|
1011
|
+
166,
|
1012
|
+
167,
|
1013
|
+
168,
|
1014
|
+
169,
|
1015
|
+
170,
|
1016
|
+
171,
|
1017
|
+
172,
|
1018
|
+
173,
|
1019
|
+
178,
|
1020
|
+
179,
|
1021
|
+
184,
|
1022
|
+
185,
|
1023
|
+
196,
|
1024
|
+
197,
|
1025
|
+
198,
|
1026
|
+
199,
|
1027
|
+
200,
|
1028
|
+
201,
|
1029
|
+
202,
|
1030
|
+
203,
|
1031
|
+
204,
|
1032
|
+
205,
|
1033
|
+
206,
|
1034
|
+
207,
|
1035
|
+
208,
|
1036
|
+
209,
|
1037
|
+
214,
|
1038
|
+
215,
|
1039
|
+
220,
|
1040
|
+
221
|
1041
|
+
];
|
1042
|
+
}
|
1043
|
+
} catch (error) {
|
1044
|
+
// Swallow - we only care if `supports-color` is available; it doesn't have to be.
|
1045
|
+
}
|
1028
1046
|
|
1029
1047
|
/**
|
1030
|
-
*
|
1031
|
-
* and the Firebug extension (any Firefox version) are known
|
1032
|
-
* to support "%c" CSS customizations.
|
1048
|
+
* Build up the default `inspectOpts` object from the environment variables.
|
1033
1049
|
*
|
1034
|
-
*
|
1050
|
+
* $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
|
1035
1051
|
*/
|
1036
1052
|
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
//
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1053
|
+
exports.inspectOpts = Object.keys(process.env).filter(key => {
|
1054
|
+
return /^debug_/i.test(key);
|
1055
|
+
}).reduce((obj, key) => {
|
1056
|
+
// Camel-case
|
1057
|
+
const prop = key
|
1058
|
+
.substring(6)
|
1059
|
+
.toLowerCase()
|
1060
|
+
.replace(/_([a-z])/g, (_, k) => {
|
1061
|
+
return k.toUpperCase();
|
1062
|
+
});
|
1045
1063
|
|
1046
|
-
//
|
1047
|
-
|
1048
|
-
|
1064
|
+
// Coerce string value into JS value
|
1065
|
+
let val = process.env[key];
|
1066
|
+
if (/^(yes|on|true|enabled)$/i.test(val)) {
|
1067
|
+
val = true;
|
1068
|
+
} else if (/^(no|off|false|disabled)$/i.test(val)) {
|
1069
|
+
val = false;
|
1070
|
+
} else if (val === 'null') {
|
1071
|
+
val = null;
|
1072
|
+
} else {
|
1073
|
+
val = Number(val);
|
1049
1074
|
}
|
1050
1075
|
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1076
|
+
obj[prop] = val;
|
1077
|
+
return obj;
|
1078
|
+
}, {});
|
1079
|
+
|
1080
|
+
/**
|
1081
|
+
* Is stdout a TTY? Colored output is enabled when `true`.
|
1082
|
+
*/
|
1083
|
+
|
1084
|
+
function useColors() {
|
1085
|
+
return 'colors' in exports.inspectOpts ?
|
1086
|
+
Boolean(exports.inspectOpts.colors) :
|
1087
|
+
tty.isatty(process.stderr.fd);
|
1061
1088
|
}
|
1062
1089
|
|
1063
1090
|
/**
|
1064
|
-
*
|
1091
|
+
* Adds ANSI color escape codes if enabled.
|
1065
1092
|
*
|
1066
1093
|
* @api public
|
1067
1094
|
*/
|
1068
1095
|
|
1069
1096
|
function formatArgs(args) {
|
1070
|
-
|
1071
|
-
this.namespace +
|
1072
|
-
(this.useColors ? ' %c' : ' ') +
|
1073
|
-
args[0] +
|
1074
|
-
(this.useColors ? '%c ' : ' ') +
|
1075
|
-
'+' + module.exports.humanize(this.diff);
|
1076
|
-
|
1077
|
-
if (!this.useColors) {
|
1078
|
-
return;
|
1079
|
-
}
|
1097
|
+
const {namespace: name, useColors} = this;
|
1080
1098
|
|
1081
|
-
|
1082
|
-
|
1099
|
+
if (useColors) {
|
1100
|
+
const c = this.color;
|
1101
|
+
const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
|
1102
|
+
const prefix = ` ${colorCode};1m${name} \u001B[0m`;
|
1083
1103
|
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
if (match === '%%') {
|
1091
|
-
return;
|
1092
|
-
}
|
1093
|
-
index++;
|
1094
|
-
if (match === '%c') {
|
1095
|
-
// We only are interested in the *last* %c
|
1096
|
-
// (the user may have provided their own)
|
1097
|
-
lastC = index;
|
1098
|
-
}
|
1099
|
-
});
|
1104
|
+
args[0] = prefix + args[0].split('\n').join('\n' + prefix);
|
1105
|
+
args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
|
1106
|
+
} else {
|
1107
|
+
args[0] = getDate() + name + ' ' + args[0];
|
1108
|
+
}
|
1109
|
+
}
|
1100
1110
|
|
1101
|
-
|
1111
|
+
function getDate() {
|
1112
|
+
if (exports.inspectOpts.hideDate) {
|
1113
|
+
return '';
|
1114
|
+
}
|
1115
|
+
return new Date().toISOString() + ' ';
|
1102
1116
|
}
|
1103
1117
|
|
1104
1118
|
/**
|
1105
|
-
* Invokes `
|
1106
|
-
* No-op when `console.debug` is not a "function".
|
1107
|
-
* If `console.debug` is not available, falls back
|
1108
|
-
* to `console.log`.
|
1109
|
-
*
|
1110
|
-
* @api public
|
1119
|
+
* Invokes `util.format()` with the specified arguments and writes to stderr.
|
1111
1120
|
*/
|
1112
|
-
|
1121
|
+
|
1122
|
+
function log(...args) {
|
1123
|
+
return process.stderr.write(util.format(...args) + '\n');
|
1124
|
+
}
|
1113
1125
|
|
1114
1126
|
/**
|
1115
1127
|
* Save `namespaces`.
|
@@ -1118,15 +1130,12 @@ function requireBrowser () {
|
|
1118
1130
|
* @api private
|
1119
1131
|
*/
|
1120
1132
|
function save(namespaces) {
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
} catch (error) {
|
1128
|
-
// Swallow
|
1129
|
-
// XXX (@Qix-) should we be logging these?
|
1133
|
+
if (namespaces) {
|
1134
|
+
process.env.DEBUG = namespaces;
|
1135
|
+
} else {
|
1136
|
+
// If you set a process.env field to null or undefined, it gets cast to the
|
1137
|
+
// string 'null' or 'undefined'. Just delete instead.
|
1138
|
+
delete process.env.DEBUG;
|
1130
1139
|
}
|
1131
1140
|
}
|
1132
1141
|
|
@@ -1136,42 +1145,24 @@ function requireBrowser () {
|
|
1136
1145
|
* @return {String} returns the previously persisted debug modes
|
1137
1146
|
* @api private
|
1138
1147
|
*/
|
1139
|
-
function load() {
|
1140
|
-
let r;
|
1141
|
-
try {
|
1142
|
-
r = exports.storage.getItem('debug');
|
1143
|
-
} catch (error) {
|
1144
|
-
// Swallow
|
1145
|
-
// XXX (@Qix-) should we be logging these?
|
1146
|
-
}
|
1147
1148
|
|
1148
|
-
|
1149
|
-
|
1150
|
-
r = process.env.DEBUG;
|
1151
|
-
}
|
1152
|
-
|
1153
|
-
return r;
|
1149
|
+
function load() {
|
1150
|
+
return process.env.DEBUG;
|
1154
1151
|
}
|
1155
1152
|
|
1156
1153
|
/**
|
1157
|
-
*
|
1158
|
-
*
|
1159
|
-
* This is necessary because safari throws
|
1160
|
-
* when a user disables cookies/localstorage
|
1161
|
-
* and you attempt to access it.
|
1154
|
+
* Init logic for `debug` instances.
|
1162
1155
|
*
|
1163
|
-
*
|
1164
|
-
*
|
1156
|
+
* Create a new `inspectOpts` object in case `useColors` is set
|
1157
|
+
* differently for a particular `debug` instance.
|
1165
1158
|
*/
|
1166
1159
|
|
1167
|
-
function
|
1168
|
-
|
1169
|
-
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1173
|
-
// Swallow
|
1174
|
-
// XXX (@Qix-) should we be logging these?
|
1160
|
+
function init(debug) {
|
1161
|
+
debug.inspectOpts = {};
|
1162
|
+
|
1163
|
+
const keys = Object.keys(exports.inspectOpts);
|
1164
|
+
for (let i = 0; i < keys.length; i++) {
|
1165
|
+
debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
|
1175
1166
|
}
|
1176
1167
|
}
|
1177
1168
|
|
@@ -1180,18 +1171,27 @@ function requireBrowser () {
|
|
1180
1171
|
const {formatters} = module.exports;
|
1181
1172
|
|
1182
1173
|
/**
|
1183
|
-
* Map %
|
1174
|
+
* Map %o to `util.inspect()`, all on a single line.
|
1184
1175
|
*/
|
1185
1176
|
|
1186
|
-
formatters.
|
1187
|
-
|
1188
|
-
|
1189
|
-
|
1190
|
-
|
1191
|
-
|
1177
|
+
formatters.o = function (v) {
|
1178
|
+
this.inspectOpts.colors = this.useColors;
|
1179
|
+
return util.inspect(v, this.inspectOpts)
|
1180
|
+
.split('\n')
|
1181
|
+
.map(str => str.trim())
|
1182
|
+
.join(' ');
|
1183
|
+
};
|
1184
|
+
|
1185
|
+
/**
|
1186
|
+
* Map %O to `util.inspect()`, allowing multiple lines if needed.
|
1187
|
+
*/
|
1188
|
+
|
1189
|
+
formatters.O = function (v) {
|
1190
|
+
this.inspectOpts.colors = this.useColors;
|
1191
|
+
return util.inspect(v, this.inspectOpts);
|
1192
1192
|
};
|
1193
|
-
} (
|
1194
|
-
return
|
1193
|
+
} (node, node.exports));
|
1194
|
+
return node.exports;
|
1195
1195
|
}
|
1196
1196
|
|
1197
1197
|
/**
|
@@ -3524,7 +3524,7 @@ function mergeConfigRecursively(defaults, overrides, rootPath) {
|
|
3524
3524
|
continue;
|
3525
3525
|
}
|
3526
3526
|
if (Array.isArray(existing) || Array.isArray(value)) {
|
3527
|
-
merged[key] = [...arraify(existing
|
3527
|
+
merged[key] = [...arraify(existing), ...arraify(value)];
|
3528
3528
|
continue;
|
3529
3529
|
}
|
3530
3530
|
if (isObject$1(existing) && isObject$1(value)) {
|
@@ -4383,9 +4383,12 @@ class Mappings {
|
|
4383
4383
|
|
4384
4384
|
addEdit(sourceIndex, content, loc, nameIndex) {
|
4385
4385
|
if (content.length) {
|
4386
|
+
const contentLengthMinusOne = content.length - 1;
|
4386
4387
|
let contentLineEnd = content.indexOf('\n', 0);
|
4387
4388
|
let previousContentLineEnd = -1;
|
4388
|
-
|
4389
|
+
// Loop through each line in the content and add a segment, but stop if the last line is empty,
|
4390
|
+
// else code afterwards would fill one line too many
|
4391
|
+
while (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) {
|
4389
4392
|
const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
|
4390
4393
|
if (nameIndex >= 0) {
|
4391
4394
|
segment.push(nameIndex);
|