vona-module-a-startup 5.0.30 → 5.0.31

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.
@@ -73,6 +73,23 @@ declare module 'vona-module-a-startup' {
73
73
  /** meta redlock: begin */
74
74
  import type { MetaRedlock } from '../bean/meta.redlock.ts';
75
75
  /** meta redlock: end */
76
+ /** hmr: begin */
77
+ export * from '../bean/hmr.startup.ts';
78
+ import 'vona';
79
+ declare module 'vona' {
80
+ interface IHmrRecord {
81
+ 'a-startup:startup': never;
82
+ }
83
+ }
84
+ declare module 'vona-module-a-startup' {
85
+ interface HmrStartup {
86
+ }
87
+ interface HmrStartup {
88
+ get $beanFullName(): 'a-startup.hmr.startup';
89
+ get $onionName(): 'a-startup:startup';
90
+ }
91
+ }
92
+ /** hmr: end */
76
93
  /** config: begin */
77
94
  export * from '../config/config.ts';
78
95
  import type { config } from '../config/config.ts';
@@ -0,0 +1,6 @@
1
+ import type { IDecoratorBeanOptionsBase } from 'vona';
2
+ import type { IHmrReload } from 'vona-module-a-hmr';
3
+ import { BeanBase } from 'vona';
4
+ export declare class HmrStartup extends BeanBase implements IHmrReload {
5
+ reload(_beanOptions: IDecoratorBeanOptionsBase): Promise<void>;
6
+ }
package/dist/index.js CHANGED
@@ -6,11 +6,12 @@ import { Service, Scope } from 'vona-module-a-bean';
6
6
  import { CacheRedis, BeanCacheRedisBase } from 'vona-module-a-cache';
7
7
  import { Meta } from 'vona-module-a-meta';
8
8
  import { BeanRedlockBase } from 'vona-module-a-redlock';
9
+ import { Hmr } from 'vona-module-a-hmr';
9
10
 
10
- var _dec$3, _dec2$3, _class$3;
11
- let ServiceStartup = (_dec$3 = Service(), _dec2$3 = BeanInfo({
11
+ var _dec$4, _dec2$4, _class$4;
12
+ let ServiceStartup = (_dec$4 = Service(), _dec2$4 = BeanInfo({
12
13
  module: "a-startup"
13
- }), _dec$3(_class$3 = _dec2$3(_class$3 = class ServiceStartup extends BeanBase {
14
+ }), _dec$4(_class$4 = _dec2$4(_class$4 = class ServiceStartup extends BeanBase {
14
15
  async appStart() {
15
16
  // clear keys
16
17
  await this._clearResources();
@@ -130,7 +131,7 @@ let ServiceStartup = (_dec$3 = Service(), _dec2$3 = BeanInfo({
130
131
  }
131
132
  }
132
133
  get _startups() {
133
- return this.bean.onion.startup.getOnionsEnabled();
134
+ return this.bean.onion.startup.getOnionsEnabledCached();
134
135
  }
135
136
  async _clearResources() {
136
137
  if (!this.app.meta.isTest) return;
@@ -139,20 +140,29 @@ let ServiceStartup = (_dec$3 = Service(), _dec2$3 = BeanInfo({
139
140
  // .app/public
140
141
  await fse.remove(path.join(this.app.config.server.publicDir, '1'));
141
142
  }
142
- }) || _class$3) || _class$3);
143
+ }) || _class$4) || _class$4);
143
144
 
144
- var _dec$2, _dec2$2, _class$2;
145
- let CacheRedisStartupDebounce = (_dec$2 = CacheRedis({
145
+ var _dec$3, _dec2$3, _class$3;
146
+ let CacheRedisStartupDebounce = (_dec$3 = CacheRedis({
146
147
  disableInstance: true,
147
148
  disableTransactionCompensate: true
148
- }), _dec2$2 = BeanInfo({
149
+ }), _dec2$3 = BeanInfo({
149
150
  module: "a-startup"
150
- }), _dec$2(_class$2 = _dec2$2(_class$2 = class CacheRedisStartupDebounce extends BeanCacheRedisBase {}) || _class$2) || _class$2);
151
+ }), _dec$3(_class$3 = _dec2$3(_class$3 = class CacheRedisStartupDebounce extends BeanCacheRedisBase {}) || _class$3) || _class$3);
152
+
153
+ var _dec$2, _dec2$2, _class$2;
154
+ let MetaRedlock = (_dec$2 = Meta(), _dec2$2 = BeanInfo({
155
+ module: "a-startup"
156
+ }), _dec$2(_class$2 = _dec2$2(_class$2 = class MetaRedlock extends BeanRedlockBase {}) || _class$2) || _class$2);
151
157
 
152
158
  var _dec$1, _dec2$1, _class$1;
153
- let MetaRedlock = (_dec$1 = Meta(), _dec2$1 = BeanInfo({
159
+ let HmrStartup = (_dec$1 = Hmr(), _dec2$1 = BeanInfo({
154
160
  module: "a-startup"
155
- }), _dec$1(_class$1 = _dec2$1(_class$1 = class MetaRedlock extends BeanRedlockBase {}) || _class$1) || _class$1);
161
+ }), _dec$1(_class$1 = _dec2$1(_class$1 = class HmrStartup extends BeanBase {
162
+ async reload(_beanOptions) {
163
+ this.app.bean.worker.reload();
164
+ }
165
+ }) || _class$1) || _class$1);
156
166
 
157
167
  function config(_app) {
158
168
  return {
@@ -184,4 +194,4 @@ function Startup(options) {
184
194
  return createBeanDecorator('startup', options);
185
195
  }
186
196
 
187
- export { CacheRedisStartupDebounce, MetaRedlock, Monkey, ScopeModuleAStartup, ServiceStartup, Startup, config };
197
+ export { CacheRedisStartupDebounce, HmrStartup, MetaRedlock, Monkey, ScopeModuleAStartup, ServiceStartup, Startup, config };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-module-a-startup",
3
3
  "type": "module",
4
- "version": "5.0.30",
4
+ "version": "5.0.31",
5
5
  "title": "a-startup",
6
6
  "vonaModule": {
7
7
  "dependencies": {},