vona-module-a-startup 5.0.12 → 5.0.14

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.
@@ -1,24 +1,33 @@
1
- import type { BeanScopeUtil, TypeModuleConfig } from 'vona';
2
- /** cacheRedis: begin */
3
- import type { IDecoratorCacheRedisOptions } from 'vona-module-a-cache';
4
- /** cacheRedis: end */
5
- /** cacheRedis: begin */
6
- import type { CacheRedisStartupDebounce } from '../bean/cacheRedis.startupDebounce.ts';
7
- /** meta: end */
8
- /** meta redlock: begin */
9
- import type { MetaRedlock } from '../bean/meta.redlock.ts';
10
- import type { config } from '../config/config.ts';
1
+ /** service: begin */
2
+ export * from '../service/startup.ts';
3
+ import 'vona';
4
+ declare module 'vona-module-a-bean' {
5
+ interface IServiceRecord {
6
+ 'a-startup:startup': never;
7
+ }
8
+ }
9
+ declare module 'vona-module-a-startup' {
10
+ interface ServiceStartup {
11
+ }
12
+ }
11
13
  /** service: end */
12
14
  /** service: begin */
13
15
  import type { ServiceStartup } from '../service/startup.ts';
14
- /** monkey: end */
15
- /** scope: begin */
16
- import { BeanScopeBase } from 'vona';
17
- import 'vona';
18
- import 'vona';
19
- import 'vona';
16
+ export interface IModuleService {
17
+ 'startup': ServiceStartup;
18
+ }
19
+ /** service: end */
20
+ /** service: begin */
20
21
  import 'vona';
22
+ declare module 'vona' {
23
+ interface IBeanRecordGeneral {
24
+ 'a-startup.service.startup': ServiceStartup;
25
+ }
26
+ }
27
+ /** service: end */
28
+ /** cacheRedis: begin */
21
29
  export * from '../bean/cacheRedis.startupDebounce.ts';
30
+ import { type IDecoratorCacheRedisOptions } from 'vona-module-a-cache';
22
31
  declare module 'vona-module-a-cache' {
23
32
  interface ICacheRedisRecord {
24
33
  'a-startup:startupDebounce': IDecoratorCacheRedisOptions;
@@ -28,12 +37,16 @@ declare module 'vona-module-a-startup' {
28
37
  interface CacheRedisStartupDebounce {
29
38
  }
30
39
  }
40
+ /** cacheRedis: end */
41
+ /** cacheRedis: begin */
42
+ import type { CacheRedisStartupDebounce } from '../bean/cacheRedis.startupDebounce.ts';
31
43
  export interface IModuleCacheRedis {
32
- startupDebounce: CacheRedisStartupDebounce;
44
+ 'startupDebounce': CacheRedisStartupDebounce;
33
45
  }
34
46
  /** cacheRedis: end */
35
47
  /** meta: begin */
36
48
  export * from '../bean/meta.redlock.ts';
49
+ import 'vona';
37
50
  declare module 'vona' {
38
51
  interface IMetaRecord {
39
52
  'a-startup:redlock': never;
@@ -43,41 +56,29 @@ declare module 'vona-module-a-startup' {
43
56
  interface MetaRedlock {
44
57
  }
45
58
  }
46
- /** service: end */
59
+ /** meta: end */
60
+ /** meta redlock: begin */
61
+ import type { MetaRedlock } from '../bean/meta.redlock.ts';
62
+ /** meta redlock: end */
47
63
  /** config: begin */
48
64
  export * from '../config/config.ts';
49
- declare module 'vona-module-a-web' {
50
- interface IServiceRecord {
51
- 'a-startup:startup': never;
52
- }
53
- }
54
- declare module 'vona-module-a-startup' {
55
- interface ServiceStartup {
56
- }
57
- }
58
- export interface IModuleService {
59
- startup: ServiceStartup;
60
- }
61
- declare module 'vona' {
62
- interface IBeanRecordGeneral {
63
- 'a-startup.service.startup': ServiceStartup;
64
- }
65
- }
65
+ import type { config } from '../config/config.ts';
66
66
  /** config: end */
67
67
  /** monkey: begin */
68
68
  export * from '../monkey.ts';
69
- /** meta redlock: end */
70
- /** service: begin */
71
- export * from '../service/startup.ts';
69
+ /** monkey: end */
70
+ /** scope: begin */
71
+ import { BeanScopeBase, type BeanScopeUtil, type TypeModuleConfig } from 'vona';
72
72
  export declare class ScopeModuleAStartup extends BeanScopeBase {
73
73
  }
74
74
  export interface ScopeModuleAStartup {
75
75
  util: BeanScopeUtil;
76
76
  config: TypeModuleConfig<typeof config>;
77
+ service: IModuleService;
77
78
  cacheRedis: IModuleCacheRedis;
78
79
  redlock: MetaRedlock;
79
- service: IModuleService;
80
80
  }
81
+ import 'vona';
81
82
  declare module 'vona' {
82
83
  interface IBeanScopeRecord {
83
84
  'a-startup': ScopeModuleAStartup;
package/dist/index.js CHANGED
@@ -1,46 +1,16 @@
1
- import { BeanInfo, BeanSimple, BeanBase, cast, BeanScopeBase, createBeanDecorator } from 'vona';
2
- import { Scope } from 'vona-module-a-bean';
3
- import { CacheRedis, BeanCacheRedisBase } from 'vona-module-a-cache';
4
- import { Meta } from 'vona-module-a-meta';
5
- import { BeanRedlockBase } from 'vona-module-a-redlock';
1
+ import { BeanInfo, BeanBase, cast, BeanSimple, BeanScopeBase, createBeanDecorator } from 'vona';
6
2
  import path from 'node:path';
7
3
  import { isNil } from '@cabloy/utils';
8
4
  import fse from 'fs-extra';
9
- import { Service } from 'vona-module-a-web';
5
+ import { Service, Scope } from 'vona-module-a-bean';
6
+ import { CacheRedis, BeanCacheRedisBase } from 'vona-module-a-cache';
7
+ import { Meta } from 'vona-module-a-meta';
8
+ import { BeanRedlockBase } from 'vona-module-a-redlock';
10
9
 
11
10
  var _dec$3, _dec2$3, _class$3;
12
- let CacheRedisStartupDebounce = (_dec$3 = CacheRedis(), _dec2$3 = BeanInfo({
13
- module: "a-startup"
14
- }), _dec$3(_class$3 = _dec2$3(_class$3 = class CacheRedisStartupDebounce extends BeanCacheRedisBase {}) || _class$3) || _class$3);
15
-
16
- var _dec$2, _dec2$2, _class$2;
17
- let MetaRedlock = (_dec$2 = Meta(), _dec2$2 = BeanInfo({
18
- module: "a-startup"
19
- }), _dec$2(_class$2 = _dec2$2(_class$2 = class MetaRedlock extends BeanRedlockBase {}) || _class$2) || _class$2);
20
-
21
- function config(_app) {
22
- return {
23
- startup: {
24
- debounce: 10 * 1000
25
- }
26
- };
27
- }
28
-
29
- const __ThisModule__ = 'a-startup';
30
-
31
- class Monkey extends BeanSimple {
32
- async appStart() {
33
- await this.bean.scope(__ThisModule__).service.startup.appStart();
34
- }
35
- async appReady() {
36
- await this.bean.scope(__ThisModule__).service.startup.appReady();
37
- }
38
- }
39
-
40
- var _dec$1, _dec2$1, _class$1;
41
- let ServiceStartup = (_dec$1 = Service(), _dec2$1 = BeanInfo({
11
+ let ServiceStartup = (_dec$3 = Service(), _dec2$3 = BeanInfo({
42
12
  module: "a-startup"
43
- }), _dec$1(_class$1 = _dec2$1(_class$1 = class ServiceStartup extends BeanBase {
13
+ }), _dec$3(_class$3 = _dec2$3(_class$3 = class ServiceStartup extends BeanBase {
44
14
  async appStart() {
45
15
  // clear keys
46
16
  await this._clearResources();
@@ -174,7 +144,36 @@ let ServiceStartup = (_dec$1 = Service(), _dec2$1 = BeanInfo({
174
144
  // .app/public
175
145
  await fse.remove(path.join(this.app.config.server.publicDir, '1'));
176
146
  }
177
- }) || _class$1) || _class$1);
147
+ }) || _class$3) || _class$3);
148
+
149
+ var _dec$2, _dec2$2, _class$2;
150
+ let CacheRedisStartupDebounce = (_dec$2 = CacheRedis(), _dec2$2 = BeanInfo({
151
+ module: "a-startup"
152
+ }), _dec$2(_class$2 = _dec2$2(_class$2 = class CacheRedisStartupDebounce extends BeanCacheRedisBase {}) || _class$2) || _class$2);
153
+
154
+ var _dec$1, _dec2$1, _class$1;
155
+ let MetaRedlock = (_dec$1 = Meta(), _dec2$1 = BeanInfo({
156
+ module: "a-startup"
157
+ }), _dec$1(_class$1 = _dec2$1(_class$1 = class MetaRedlock extends BeanRedlockBase {}) || _class$1) || _class$1);
158
+
159
+ function config(_app) {
160
+ return {
161
+ startup: {
162
+ debounce: 10 * 1000
163
+ }
164
+ };
165
+ }
166
+
167
+ const __ThisModule__ = 'a-startup';
168
+
169
+ class Monkey extends BeanSimple {
170
+ async appStart() {
171
+ await this.bean.scope(__ThisModule__).service.startup.appStart();
172
+ }
173
+ async appReady() {
174
+ await this.bean.scope(__ThisModule__).service.startup.appReady();
175
+ }
176
+ }
178
177
 
179
178
  var _dec, _dec2, _class;
180
179
  let ScopeModuleAStartup = (_dec = Scope(), _dec2 = BeanInfo({
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.12",
4
+ "version": "5.0.14",
5
5
  "title": "a-startup",
6
6
  "vonaModule": {
7
7
  "dependencies": {},