mol_wire_lib 1.0.179 → 1.0.180
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/node.d.ts +28 -18
- package/node.deps.json +1 -1
- package/node.esm.js +66 -101
- package/node.esm.js.map +1 -1
- package/node.js +66 -101
- package/node.js.map +1 -1
- package/node.test.js +186 -124
- package/node.test.js.map +1 -1
- package/package.json +5 -9
- package/web.d.ts +2 -2
- package/web.deps.json +1 -1
- package/web.esm.js +12 -2
- package/web.esm.js.map +1 -1
- package/web.js +12 -2
- package/web.js.map +1 -1
- package/web.test.js +18 -9
- package/web.test.js.map +1 -1
package/node.js
CHANGED
|
@@ -1178,7 +1178,12 @@ var $;
|
|
|
1178
1178
|
const fiber = temp(obj, args);
|
|
1179
1179
|
return fiber.sync();
|
|
1180
1180
|
};
|
|
1181
|
-
}
|
|
1181
|
+
},
|
|
1182
|
+
apply(obj, self, args) {
|
|
1183
|
+
const temp = $mol_wire_task.getter(obj);
|
|
1184
|
+
const fiber = temp(self, args);
|
|
1185
|
+
return fiber.sync();
|
|
1186
|
+
},
|
|
1182
1187
|
});
|
|
1183
1188
|
}
|
|
1184
1189
|
$.$mol_wire_sync = $mol_wire_sync;
|
|
@@ -1201,7 +1206,12 @@ var $;
|
|
|
1201
1206
|
fiber = temp(obj, args);
|
|
1202
1207
|
return fiber.async();
|
|
1203
1208
|
};
|
|
1204
|
-
}
|
|
1209
|
+
},
|
|
1210
|
+
apply(obj, self, args) {
|
|
1211
|
+
const temp = $mol_wire_task.getter(obj);
|
|
1212
|
+
const fiber = temp(self, args);
|
|
1213
|
+
return fiber.async();
|
|
1214
|
+
},
|
|
1205
1215
|
});
|
|
1206
1216
|
}
|
|
1207
1217
|
$.$mol_wire_async = $mol_wire_async;
|
|
@@ -1544,48 +1554,6 @@ var $;
|
|
|
1544
1554
|
//mol/log3/log3.ts
|
|
1545
1555
|
;
|
|
1546
1556
|
"use strict";
|
|
1547
|
-
//node/node.ts
|
|
1548
|
-
;
|
|
1549
|
-
"use strict";
|
|
1550
|
-
var $node = new Proxy({ require }, {
|
|
1551
|
-
get(target, name, wrapper) {
|
|
1552
|
-
if (target[name])
|
|
1553
|
-
return target[name];
|
|
1554
|
-
const mod = target.require('module');
|
|
1555
|
-
if (mod.builtinModules.indexOf(name) >= 0)
|
|
1556
|
-
return target.require(name);
|
|
1557
|
-
const path = target.require('path');
|
|
1558
|
-
const fs = target.require('fs');
|
|
1559
|
-
let dir = path.resolve('.');
|
|
1560
|
-
const suffix = `./node_modules/${name}`;
|
|
1561
|
-
const $$ = $;
|
|
1562
|
-
while (!fs.existsSync(path.join(dir, suffix))) {
|
|
1563
|
-
const parent = path.resolve(dir, '..');
|
|
1564
|
-
if (parent === dir) {
|
|
1565
|
-
$$.$mol_exec('.', 'npm', 'install', name);
|
|
1566
|
-
try {
|
|
1567
|
-
$$.$mol_exec('.', 'npm', 'install', '@types/' + name);
|
|
1568
|
-
}
|
|
1569
|
-
catch { }
|
|
1570
|
-
break;
|
|
1571
|
-
}
|
|
1572
|
-
else {
|
|
1573
|
-
dir = parent;
|
|
1574
|
-
}
|
|
1575
|
-
}
|
|
1576
|
-
return target.require(name);
|
|
1577
|
-
},
|
|
1578
|
-
set(target, name, value) {
|
|
1579
|
-
target[name] = value;
|
|
1580
|
-
return true;
|
|
1581
|
-
},
|
|
1582
|
-
});
|
|
1583
|
-
require = (req => Object.assign(function require(name) {
|
|
1584
|
-
return $node[name];
|
|
1585
|
-
}, req))(require);
|
|
1586
|
-
//node/node.node.ts
|
|
1587
|
-
;
|
|
1588
|
-
"use strict";
|
|
1589
1557
|
var $;
|
|
1590
1558
|
(function ($) {
|
|
1591
1559
|
$.$mol_tree_convert = Symbol('$mol_tree_convert');
|
|
@@ -1917,80 +1885,77 @@ var $;
|
|
|
1917
1885
|
;
|
|
1918
1886
|
"use strict";
|
|
1919
1887
|
var $;
|
|
1888
|
+
(function ($) {
|
|
1889
|
+
class $mol_term_color {
|
|
1890
|
+
static reset = this.ansi(0, 0);
|
|
1891
|
+
static bold = this.ansi(1, 22);
|
|
1892
|
+
static italic = this.ansi(3, 23);
|
|
1893
|
+
static underline = this.ansi(4, 24);
|
|
1894
|
+
static inverse = this.ansi(7, 27);
|
|
1895
|
+
static hidden = this.ansi(8, 28);
|
|
1896
|
+
static strike = this.ansi(9, 29);
|
|
1897
|
+
static gray = this.ansi(90, 39);
|
|
1898
|
+
static red = this.ansi(91, 39);
|
|
1899
|
+
static green = this.ansi(92, 39);
|
|
1900
|
+
static yellow = this.ansi(93, 39);
|
|
1901
|
+
static blue = this.ansi(94, 39);
|
|
1902
|
+
static magenta = this.ansi(95, 39);
|
|
1903
|
+
static cyan = this.ansi(96, 39);
|
|
1904
|
+
static white = this.ansi(97, 39);
|
|
1905
|
+
static Red = (str) => this.inverse(this.red(str));
|
|
1906
|
+
static Green = (str) => this.inverse(this.green(str));
|
|
1907
|
+
static Yellow = (str) => this.inverse(this.yellow(str));
|
|
1908
|
+
static Blue = (str) => this.inverse(this.blue(str));
|
|
1909
|
+
static Magenta = (str) => this.inverse(this.magenta(str));
|
|
1910
|
+
static Cyan = (str) => this.inverse(this.cyan(str));
|
|
1911
|
+
static White = (str) => this.inverse(this.white(str));
|
|
1912
|
+
static ansi(open, close) {
|
|
1913
|
+
if (typeof process === 'undefined')
|
|
1914
|
+
return String;
|
|
1915
|
+
if (!process.stdout.isTTY)
|
|
1916
|
+
return String;
|
|
1917
|
+
const prefix = `\x1b[${open}m`;
|
|
1918
|
+
const postfix = `\x1b[${close}m`;
|
|
1919
|
+
const suffix_regexp = new RegExp(postfix.replace('[', '\\['), 'g');
|
|
1920
|
+
return function colorer(str) {
|
|
1921
|
+
str = String(str);
|
|
1922
|
+
if (str === '')
|
|
1923
|
+
return str;
|
|
1924
|
+
const suffix = str.replace(suffix_regexp, prefix);
|
|
1925
|
+
return prefix + suffix + postfix;
|
|
1926
|
+
};
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
$.$mol_term_color = $mol_term_color;
|
|
1930
|
+
})($ || ($ = {}));
|
|
1931
|
+
//mol/term/color/color.ts
|
|
1932
|
+
;
|
|
1933
|
+
"use strict";
|
|
1934
|
+
var $;
|
|
1920
1935
|
(function ($) {
|
|
1921
1936
|
function $mol_log3_node_make(level, output, type, color) {
|
|
1922
1937
|
return function $mol_log3_logger(event) {
|
|
1923
1938
|
if (!event.time)
|
|
1924
1939
|
event = { time: new Date().toISOString(), ...event };
|
|
1925
1940
|
const tree = this.$mol_tree.fromJSON(event).clone({ type });
|
|
1926
|
-
let str = tree.toString();
|
|
1927
|
-
if (process[output].isTTY) {
|
|
1928
|
-
str = $node.colorette[color + 'Bright'](str);
|
|
1929
|
-
}
|
|
1930
|
-
;
|
|
1941
|
+
let str = color(tree.toString());
|
|
1931
1942
|
this.console[level](str);
|
|
1932
1943
|
const self = this;
|
|
1933
1944
|
return () => self.console.groupEnd();
|
|
1934
1945
|
};
|
|
1935
1946
|
}
|
|
1936
1947
|
$.$mol_log3_node_make = $mol_log3_node_make;
|
|
1937
|
-
$.$mol_log3_come = $mol_log3_node_make('info', 'stdout', 'come',
|
|
1938
|
-
$.$mol_log3_done = $mol_log3_node_make('info', 'stdout', 'done',
|
|
1939
|
-
$.$mol_log3_fail = $mol_log3_node_make('error', 'stderr', 'fail',
|
|
1940
|
-
$.$mol_log3_warn = $mol_log3_node_make('warn', 'stderr', 'warn',
|
|
1941
|
-
$.$mol_log3_rise = $mol_log3_node_make('log', 'stdout', 'rise',
|
|
1942
|
-
$.$mol_log3_area = $mol_log3_node_make('log', 'stdout', 'area',
|
|
1948
|
+
$.$mol_log3_come = $mol_log3_node_make('info', 'stdout', 'come', $mol_term_color.blue);
|
|
1949
|
+
$.$mol_log3_done = $mol_log3_node_make('info', 'stdout', 'done', $mol_term_color.green);
|
|
1950
|
+
$.$mol_log3_fail = $mol_log3_node_make('error', 'stderr', 'fail', $mol_term_color.red);
|
|
1951
|
+
$.$mol_log3_warn = $mol_log3_node_make('warn', 'stderr', 'warn', $mol_term_color.yellow);
|
|
1952
|
+
$.$mol_log3_rise = $mol_log3_node_make('log', 'stdout', 'rise', $mol_term_color.magenta);
|
|
1953
|
+
$.$mol_log3_area = $mol_log3_node_make('log', 'stdout', 'area', $mol_term_color.cyan);
|
|
1943
1954
|
})($ || ($ = {}));
|
|
1944
1955
|
//mol/log3/log3.node.ts
|
|
1945
1956
|
;
|
|
1946
1957
|
"use strict";
|
|
1947
1958
|
var $;
|
|
1948
|
-
(function ($) {
|
|
1949
|
-
function $mol_env() {
|
|
1950
|
-
return {};
|
|
1951
|
-
}
|
|
1952
|
-
$.$mol_env = $mol_env;
|
|
1953
|
-
})($ || ($ = {}));
|
|
1954
|
-
//mol/env/env.ts
|
|
1955
|
-
;
|
|
1956
|
-
"use strict";
|
|
1957
|
-
var $;
|
|
1958
|
-
(function ($) {
|
|
1959
|
-
$.$mol_env = function $mol_env() {
|
|
1960
|
-
return this.process.env;
|
|
1961
|
-
};
|
|
1962
|
-
})($ || ($ = {}));
|
|
1963
|
-
//mol/env/env.node.ts
|
|
1964
|
-
;
|
|
1965
|
-
"use strict";
|
|
1966
|
-
var $;
|
|
1967
|
-
(function ($) {
|
|
1968
|
-
function $mol_exec(dir, command, ...args) {
|
|
1969
|
-
let [app, ...args0] = command.split(' ');
|
|
1970
|
-
args = [...args0, ...args];
|
|
1971
|
-
this.$mol_log3_come({
|
|
1972
|
-
place: '$mol_exec',
|
|
1973
|
-
dir: $node.path.relative('', dir),
|
|
1974
|
-
message: 'Run',
|
|
1975
|
-
command: `${app} ${args.join(' ')}`,
|
|
1976
|
-
});
|
|
1977
|
-
var res = $node['child_process'].spawnSync(app, args, {
|
|
1978
|
-
cwd: $node.path.resolve(dir),
|
|
1979
|
-
shell: true,
|
|
1980
|
-
env: this.$mol_env(),
|
|
1981
|
-
});
|
|
1982
|
-
if (res.status || res.error)
|
|
1983
|
-
return $mol_fail(res.error || new Error(res.stderr.toString()));
|
|
1984
|
-
if (!res.stdout)
|
|
1985
|
-
res.stdout = Buffer.from([]);
|
|
1986
|
-
return res;
|
|
1987
|
-
}
|
|
1988
|
-
$.$mol_exec = $mol_exec;
|
|
1989
|
-
})($ || ($ = {}));
|
|
1990
|
-
//mol/exec/exec.node.ts
|
|
1991
|
-
;
|
|
1992
|
-
"use strict";
|
|
1993
|
-
var $;
|
|
1994
1959
|
(function ($) {
|
|
1995
1960
|
class $mol_wire_log extends $mol_object2 {
|
|
1996
1961
|
static watch(task) {
|