mol_plot_all 1.2.1175 → 1.2.1176

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.js CHANGED
@@ -2003,7 +2003,11 @@ var $node = new Proxy({ require }, {
2003
2003
  try {
2004
2004
  $$.$mol_exec('.', 'npm', 'install', '--omit=dev', '@types/' + name);
2005
2005
  }
2006
- catch { }
2006
+ catch (e) {
2007
+ if ($$.$mol_fail_catch(e)) {
2008
+ $$.$mol_fail_log(e);
2009
+ }
2010
+ }
2007
2011
  break;
2008
2012
  }
2009
2013
  else {
@@ -2014,7 +2018,7 @@ var $node = new Proxy({ require }, {
2014
2018
  return target.require(name);
2015
2019
  }
2016
2020
  catch (error) {
2017
- if (error.code === 'ERR_REQUIRE_ESM') {
2021
+ if ($.$mol_fail_catch(error) && error.code === 'ERR_REQUIRE_ESM') {
2018
2022
  const module = cache.get(name);
2019
2023
  if (module)
2020
2024
  return module;
@@ -2087,10 +2091,19 @@ var $;
2087
2091
  "use strict";
2088
2092
  var $;
2089
2093
  (function ($) {
2094
+ const factories = new WeakMap();
2095
+ function factory(val) {
2096
+ let make = factories.get(val);
2097
+ if (make)
2098
+ return make;
2099
+ make = $mol_func_name_from((...args) => new val(...args), val);
2100
+ factories.set(val, make);
2101
+ return make;
2102
+ }
2090
2103
  function $mol_wire_sync(obj) {
2091
2104
  return new Proxy(obj, {
2092
2105
  get(obj, field) {
2093
- const val = obj[field];
2106
+ let val = obj[field];
2094
2107
  if (typeof val !== 'function')
2095
2108
  return val;
2096
2109
  const temp = $mol_wire_task.getter(val);
@@ -2099,10 +2112,13 @@ var $;
2099
2112
  return fiber.sync();
2100
2113
  };
2101
2114
  },
2115
+ construct(obj, args) {
2116
+ const temp = $mol_wire_task.getter(factory(obj));
2117
+ return temp(obj, args).sync();
2118
+ },
2102
2119
  apply(obj, self, args) {
2103
2120
  const temp = $mol_wire_task.getter(obj);
2104
- const fiber = temp(self, args);
2105
- return fiber.sync();
2121
+ return temp(self, args).sync();
2106
2122
  },
2107
2123
  });
2108
2124
  }
@@ -2118,9 +2134,19 @@ var $;
2118
2134
  $.$mol_run_error = $mol_run_error;
2119
2135
  const child_process = $node['child_process'];
2120
2136
  $.$mol_run_spawn = child_process.spawn.bind(child_process);
2137
+ $.$mol_run_spawn_sync = child_process.spawnSync.bind(child_process);
2121
2138
  function $mol_run_async({ dir, timeout, command, env }) {
2122
2139
  const args_raw = typeof command === 'string' ? command.split(' ') : command;
2123
2140
  const [app, ...args] = args_raw;
2141
+ if (!env?.MOL_RUN_ASYNC) {
2142
+ this.$mol_log3_come({
2143
+ place: '$mol_run_sync',
2144
+ message: 'Run',
2145
+ command: args_raw.join(' '),
2146
+ dir: $node.path.relative('', dir),
2147
+ });
2148
+ return this.$mol_run_spawn_sync(app, args, { shell: true, cwd: dir, env });
2149
+ }
2124
2150
  const sub = this.$mol_run_spawn(app, args, {
2125
2151
  shell: true,
2126
2152
  cwd: dir,