@modern-js/plugin 1.3.7 → 1.3.8

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @modern-js/plugin
2
2
 
3
+ ## 1.3.8
4
+
5
+ ### Patch Changes
6
+
7
+ - b7302f781: Export some required types
8
+ - e0e708f83: perf(app-tools): speed up modern start command
9
+
3
10
  ## 1.3.7
4
11
 
5
12
  ### Patch Changes
@@ -60,15 +60,21 @@ const createAsyncHooks = () => {
60
60
  };
61
61
  };
62
62
 
63
+ let enabled = false;
63
64
  export const enable = () => {
65
+ if (enabled) {
66
+ return;
67
+ }
68
+
69
+ enabled = true;
64
70
  const hooks = createAsyncHooks();
65
- disable();
66
71
  asyncHooksInterface.impl(hooks);
67
72
  hooks.enable();
68
73
  };
69
74
  export const disable = () => {
70
75
  var _asyncHooksInterface$;
71
76
 
77
+ enabled = false;
72
78
  (_asyncHooksInterface$ = asyncHooksInterface.asyncHooks) === null || _asyncHooksInterface$ === void 0 ? void 0 : _asyncHooksInterface$.disable();
73
79
  asyncHooksInterface.reset();
74
80
  };
@@ -74,9 +74,15 @@ const createAsyncHooks = () => {
74
74
  };
75
75
  };
76
76
 
77
+ let enabled = false;
78
+
77
79
  const enable = () => {
80
+ if (enabled) {
81
+ return;
82
+ }
83
+
84
+ enabled = true;
78
85
  const hooks = createAsyncHooks();
79
- disable();
80
86
  asyncHooksInterface.impl(hooks);
81
87
  hooks.enable();
82
88
  };
@@ -86,6 +92,7 @@ exports.enable = enable;
86
92
  const disable = () => {
87
93
  var _asyncHooksInterface$;
88
94
 
95
+ enabled = false;
89
96
  (_asyncHooksInterface$ = asyncHooksInterface.asyncHooks) === null || _asyncHooksInterface$ === void 0 ? void 0 : _asyncHooksInterface$.disable();
90
97
  asyncHooksInterface.reset();
91
98
  };
@@ -60,15 +60,21 @@ var createAsyncHooks = function createAsyncHooks() {
60
60
  };
61
61
  };
62
62
 
63
+ var enabled = false;
63
64
  export var enable = function enable() {
65
+ if (enabled) {
66
+ return;
67
+ }
68
+
69
+ enabled = true;
64
70
  var hooks = createAsyncHooks();
65
- disable();
66
71
  asyncHooksInterface.impl(hooks);
67
72
  hooks.enable();
68
73
  };
69
74
  export var disable = function disable() {
70
75
  var _asyncHooksInterface$;
71
76
 
77
+ enabled = false;
72
78
  (_asyncHooksInterface$ = asyncHooksInterface.asyncHooks) === null || _asyncHooksInterface$ === void 0 ? void 0 : _asyncHooksInterface$.disable();
73
79
  asyncHooksInterface.reset();
74
80
  };
@@ -21,8 +21,8 @@ export declare const createContainer: (ContextStorage?: ContextStorage) => Conta
21
21
  export declare type Hooks = {
22
22
  useContainer: () => Container;
23
23
  };
24
+ export type { AnyFn } from './asyncHooksInterface';
24
25
  export declare const runHooks: <F extends import("./asyncHooksInterface").AnyFn>(f: F, implementations: Hooks) => ReturnType<F>;
25
26
  export declare const useContainer: () => Container;
26
27
  export declare const fromContainer: (container: Container) => Hooks;
27
- export declare const runWithContainer: <F extends (...args: any) => any>(f: F, container: Container) => ReturnType<F>;
28
- export {};
28
+ export declare const runWithContainer: <F extends (...args: any) => any>(f: F, container: Container) => ReturnType<F>;
@@ -1,2 +1,3 @@
1
+ export type { Context } from '../farrow-pipeline/context';
1
2
  export declare const RunnerContext: import("../farrow-pipeline").Context<any>;
2
3
  export declare const useRunner: () => any;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.3.7",
14
+ "version": "1.3.8",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",