mol_jsx_lib 0.0.1051 → 0.0.1052

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.mjs CHANGED
@@ -116,27 +116,19 @@ var $node = new Proxy({ require }, {
116
116
  return target.require(name);
117
117
  if (name[0] === '.')
118
118
  return target.require(name);
119
- const path = target.require('path');
120
- const fs = target.require('fs');
121
- let dir = path.resolve('.');
122
- const suffix = `./node_modules/${name}`;
123
- const $$ = $;
124
- while (!fs.existsSync(path.join(dir, suffix))) {
125
- const parent = path.resolve(dir, '..');
126
- if (parent === dir) {
127
- $$.$mol_exec('.', 'npm', 'install', '--omit=dev', name);
128
- try {
129
- $$.$mol_exec('.', 'npm', 'install', '--omit=dev', '@types/' + name);
130
- }
131
- catch (e) {
132
- if ($$.$mol_fail_catch(e)) {
133
- $$.$mol_fail_log(e);
134
- }
135
- }
136
- break;
119
+ try {
120
+ target.require.resolve(name);
121
+ }
122
+ catch {
123
+ const $$ = $;
124
+ $$.$mol_exec('.', 'npm', 'install', '--omit=dev', name);
125
+ try {
126
+ $$.$mol_exec('.', 'npm', 'install', '--omit=dev', '@types/' + name);
137
127
  }
138
- else {
139
- dir = parent;
128
+ catch (e) {
129
+ if ($$.$mol_fail_catch(e)) {
130
+ $$.$mol_fail_log(e);
131
+ }
140
132
  }
141
133
  }
142
134
  try {
@@ -1767,7 +1759,10 @@ var $;
1767
1759
  command: args_raw.join(' '),
1768
1760
  dir: $node.path.relative('', dir),
1769
1761
  });
1770
- return this.$mol_run_spawn_sync(app, args, { shell: true, cwd: dir, env });
1762
+ const res = this.$mol_run_spawn_sync(app, args, { shell: true, cwd: dir, env });
1763
+ if (res.status)
1764
+ $mol_fail(new Error(res.stderr.toString() || 'Exit(' + res.status + ')'));
1765
+ return res;
1771
1766
  }
1772
1767
  const sub = this.$mol_run_spawn(app, args, {
1773
1768
  shell: true,
package/node.test.js CHANGED
@@ -107,27 +107,19 @@ var $node = new Proxy({ require }, {
107
107
  return target.require(name);
108
108
  if (name[0] === '.')
109
109
  return target.require(name);
110
- const path = target.require('path');
111
- const fs = target.require('fs');
112
- let dir = path.resolve('.');
113
- const suffix = `./node_modules/${name}`;
114
- const $$ = $;
115
- while (!fs.existsSync(path.join(dir, suffix))) {
116
- const parent = path.resolve(dir, '..');
117
- if (parent === dir) {
118
- $$.$mol_exec('.', 'npm', 'install', '--omit=dev', name);
119
- try {
120
- $$.$mol_exec('.', 'npm', 'install', '--omit=dev', '@types/' + name);
121
- }
122
- catch (e) {
123
- if ($$.$mol_fail_catch(e)) {
124
- $$.$mol_fail_log(e);
125
- }
126
- }
127
- break;
110
+ try {
111
+ target.require.resolve(name);
112
+ }
113
+ catch {
114
+ const $$ = $;
115
+ $$.$mol_exec('.', 'npm', 'install', '--omit=dev', name);
116
+ try {
117
+ $$.$mol_exec('.', 'npm', 'install', '--omit=dev', '@types/' + name);
128
118
  }
129
- else {
130
- dir = parent;
119
+ catch (e) {
120
+ if ($$.$mol_fail_catch(e)) {
121
+ $$.$mol_fail_log(e);
122
+ }
131
123
  }
132
124
  }
133
125
  try {
@@ -1758,7 +1750,10 @@ var $;
1758
1750
  command: args_raw.join(' '),
1759
1751
  dir: $node.path.relative('', dir),
1760
1752
  });
1761
- return this.$mol_run_spawn_sync(app, args, { shell: true, cwd: dir, env });
1753
+ const res = this.$mol_run_spawn_sync(app, args, { shell: true, cwd: dir, env });
1754
+ if (res.status)
1755
+ $mol_fail(new Error(res.stderr.toString() || 'Exit(' + res.status + ')'));
1756
+ return res;
1762
1757
  }
1763
1758
  const sub = this.$mol_run_spawn(app, args, {
1764
1759
  shell: true,
@@ -3050,18 +3045,6 @@ var $;
3050
3045
  $mol_test_mocks.push($ => $.$mol_fail_log = () => false);
3051
3046
  })($ || ($ = {}));
3052
3047
 
3053
- ;
3054
- "use strict";
3055
-
3056
- ;
3057
- "use strict";
3058
-
3059
- ;
3060
- "use strict";
3061
-
3062
- ;
3063
- "use strict";
3064
-
3065
3048
  ;
3066
3049
  "use strict";
3067
3050
  var $;
@@ -3208,6 +3191,15 @@ var $;
3208
3191
  ;
3209
3192
  "use strict";
3210
3193
 
3194
+ ;
3195
+ "use strict";
3196
+
3197
+ ;
3198
+ "use strict";
3199
+
3200
+ ;
3201
+ "use strict";
3202
+
3211
3203
  ;
3212
3204
  "use strict";
3213
3205
  var $;
@@ -3829,6 +3821,9 @@ var $;
3829
3821
  });
3830
3822
  })($ || ($ = {}));
3831
3823
 
3824
+ ;
3825
+ "use strict";
3826
+
3832
3827
  ;
3833
3828
  "use strict";
3834
3829
  var $;