@kcuf/sls-logger-base 0.0.1

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.
Files changed (129) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +71 -0
  3. package/coverage/base.css +224 -0
  4. package/coverage/block-navigation.js +87 -0
  5. package/coverage/clover.xml +417 -0
  6. package/coverage/coverage-final.json +20 -0
  7. package/coverage/favicon.png +0 -0
  8. package/coverage/index.html +176 -0
  9. package/coverage/prettify.css +1 -0
  10. package/coverage/prettify.js +2 -0
  11. package/coverage/sort-arrow-sprite.png +0 -0
  12. package/coverage/sorter.js +196 -0
  13. package/coverage/src/class/index.html +146 -0
  14. package/coverage/src/class/index.ts.html +85 -0
  15. package/coverage/src/class/sls-logger.ts.html +457 -0
  16. package/coverage/src/class/sls-pipe.ts.html +400 -0
  17. package/coverage/src/const/index.html +116 -0
  18. package/coverage/src/const/index.ts.html +127 -0
  19. package/coverage/src/factory/create-logger.ts.html +166 -0
  20. package/coverage/src/factory/generate-create-logger.ts.html +184 -0
  21. package/coverage/src/factory/index.html +131 -0
  22. package/coverage/src/index.html +116 -0
  23. package/coverage/src/index.ts.html +118 -0
  24. package/coverage/src/util/build-post-body.ts.html +166 -0
  25. package/coverage/src/util/convert-error-to-plain.ts.html +133 -0
  26. package/coverage/src/util/convert-log-info.ts.html +214 -0
  27. package/coverage/src/util/create-sls-log-quick.ts.html +157 -0
  28. package/coverage/src/util/flatten-object.ts.html +283 -0
  29. package/coverage/src/util/flatten-should-ignore.ts.html +151 -0
  30. package/coverage/src/util/get-log-once-key.ts.html +115 -0
  31. package/coverage/src/util/get-silent-countdown.ts.html +97 -0
  32. package/coverage/src/util/index.html +281 -0
  33. package/coverage/src/util/index.ts.html +112 -0
  34. package/coverage/src/util/merge-default-params.ts.html +148 -0
  35. package/coverage/src/util/merge-should-ignore.ts.html +115 -0
  36. package/coverage/src/util/resolve-default-params.ts.html +103 -0
  37. package/dist/cjs/class/index.js +13 -0
  38. package/dist/cjs/class/sls-logger.js +118 -0
  39. package/dist/cjs/class/sls-pipe.js +110 -0
  40. package/dist/cjs/const/index.js +18 -0
  41. package/dist/cjs/factory/create-logger.js +22 -0
  42. package/dist/cjs/factory/generate-create-logger.js +30 -0
  43. package/dist/cjs/index.js +20 -0
  44. package/dist/cjs/types/common.js +5 -0
  45. package/dist/cjs/types/factory.js +5 -0
  46. package/dist/cjs/types/index.js +38 -0
  47. package/dist/cjs/types/options.js +5 -0
  48. package/dist/cjs/util/build-post-body.js +25 -0
  49. package/dist/cjs/util/convert-error-to-plain.js +21 -0
  50. package/dist/cjs/util/convert-log-info.js +44 -0
  51. package/dist/cjs/util/create-sls-log-quick.js +34 -0
  52. package/dist/cjs/util/flatten-object.js +60 -0
  53. package/dist/cjs/util/flatten-should-ignore.js +22 -0
  54. package/dist/cjs/util/get-log-once-key.js +15 -0
  55. package/dist/cjs/util/get-silent-countdown.js +10 -0
  56. package/dist/cjs/util/index.js +69 -0
  57. package/dist/cjs/util/merge-default-params.js +21 -0
  58. package/dist/cjs/util/merge-should-ignore.js +14 -0
  59. package/dist/cjs/util/resolve-default-params.js +9 -0
  60. package/dist/esm/class/index.js +2 -0
  61. package/dist/esm/class/index.js.map +1 -0
  62. package/dist/esm/class/sls-logger.js +114 -0
  63. package/dist/esm/class/sls-logger.js.map +1 -0
  64. package/dist/esm/class/sls-pipe.js +106 -0
  65. package/dist/esm/class/sls-pipe.js.map +1 -0
  66. package/dist/esm/const/index.js +13 -0
  67. package/dist/esm/const/index.js.map +1 -0
  68. package/dist/esm/factory/create-logger.js +18 -0
  69. package/dist/esm/factory/create-logger.js.map +1 -0
  70. package/dist/esm/factory/generate-create-logger.js +25 -0
  71. package/dist/esm/factory/generate-create-logger.js.map +1 -0
  72. package/dist/esm/index.js +3 -0
  73. package/dist/esm/index.js.map +1 -0
  74. package/dist/esm/types/common.js +2 -0
  75. package/dist/esm/types/common.js.map +1 -0
  76. package/dist/esm/types/factory.js +2 -0
  77. package/dist/esm/types/factory.js.map +1 -0
  78. package/dist/esm/types/index.js +4 -0
  79. package/dist/esm/types/index.js.map +1 -0
  80. package/dist/esm/types/options.js +2 -0
  81. package/dist/esm/types/options.js.map +1 -0
  82. package/dist/esm/util/build-post-body.js +20 -0
  83. package/dist/esm/util/build-post-body.js.map +1 -0
  84. package/dist/esm/util/convert-error-to-plain.js +16 -0
  85. package/dist/esm/util/convert-error-to-plain.js.map +1 -0
  86. package/dist/esm/util/convert-log-info.js +39 -0
  87. package/dist/esm/util/convert-log-info.js.map +1 -0
  88. package/dist/esm/util/create-sls-log-quick.js +28 -0
  89. package/dist/esm/util/create-sls-log-quick.js.map +1 -0
  90. package/dist/esm/util/flatten-object.js +55 -0
  91. package/dist/esm/util/flatten-object.js.map +1 -0
  92. package/dist/esm/util/flatten-should-ignore.js +17 -0
  93. package/dist/esm/util/flatten-should-ignore.js.map +1 -0
  94. package/dist/esm/util/get-log-once-key.js +10 -0
  95. package/dist/esm/util/get-log-once-key.js.map +1 -0
  96. package/dist/esm/util/get-silent-countdown.js +5 -0
  97. package/dist/esm/util/get-silent-countdown.js.map +1 -0
  98. package/dist/esm/util/index.js +10 -0
  99. package/dist/esm/util/index.js.map +1 -0
  100. package/dist/esm/util/merge-default-params.js +16 -0
  101. package/dist/esm/util/merge-default-params.js.map +1 -0
  102. package/dist/esm/util/merge-should-ignore.js +9 -0
  103. package/dist/esm/util/merge-should-ignore.js.map +1 -0
  104. package/dist/esm/util/resolve-default-params.js +4 -0
  105. package/dist/esm/util/resolve-default-params.js.map +1 -0
  106. package/dist/types/class/index.d.ts +1 -0
  107. package/dist/types/class/sls-logger.d.ts +15 -0
  108. package/dist/types/class/sls-pipe.d.ts +27 -0
  109. package/dist/types/const/index.d.ts +11 -0
  110. package/dist/types/factory/create-logger.d.ts +5 -0
  111. package/dist/types/factory/generate-create-logger.d.ts +7 -0
  112. package/dist/types/index.d.ts +3 -0
  113. package/dist/types/types/common.d.ts +32 -0
  114. package/dist/types/types/factory.d.ts +30 -0
  115. package/dist/types/types/index.d.ts +3 -0
  116. package/dist/types/types/options.d.ts +123 -0
  117. package/dist/types/util/build-post-body.d.ts +8 -0
  118. package/dist/types/util/convert-error-to-plain.d.ts +4 -0
  119. package/dist/types/util/convert-log-info.d.ts +8 -0
  120. package/dist/types/util/create-sls-log-quick.d.ts +2 -0
  121. package/dist/types/util/flatten-object.d.ts +13 -0
  122. package/dist/types/util/flatten-should-ignore.d.ts +2 -0
  123. package/dist/types/util/get-log-once-key.d.ts +1 -0
  124. package/dist/types/util/get-silent-countdown.d.ts +1 -0
  125. package/dist/types/util/index.d.ts +9 -0
  126. package/dist/types/util/merge-default-params.d.ts +5 -0
  127. package/dist/types/util/merge-should-ignore.d.ts +2 -0
  128. package/dist/types/util/resolve-default-params.d.ts +2 -0
  129. package/package.json +55 -0
@@ -0,0 +1,27 @@
1
+ import { ISlsLogPayload, ISlsPipeOptions, ILogSender } from '../types';
2
+ /**
3
+ * SLS 日志管道,用于在一定的时间内积压日志,以避免造成业务请求性能问题
4
+ */
5
+ export default class SlsPipe {
6
+ private readonly sender;
7
+ private readonly options;
8
+ private queue;
9
+ private timer;
10
+ private silent;
11
+ constructor(sender: ILogSender, options: ISlsPipeOptions);
12
+ /**
13
+ * 将日志推入队列,并通知发送
14
+ */
15
+ pipe(payload: ISlsLogPayload, instant?: boolean): void;
16
+ private signalSend;
17
+ /**
18
+ * 真正发送日志
19
+ */
20
+ private sendLogs;
21
+ /**
22
+ * 把队列中的日志全部发送并重置队列
23
+ */
24
+ private clearQueue;
25
+ private clearTimer;
26
+ private refreshTimer;
27
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * 合并日志的最外层的 topic
3
+ */
4
+ export declare const TOPIC_MERGED = "SLS_MERGED";
5
+ /**
6
+ * 定死的 API 版本,GET 的时候为参数 `APIVersion`,POST 的时候为 header `x-log-apiversion`
7
+ */
8
+ export declare const API_VERSION = "0.6.0";
9
+ export declare const PIPE_SILENT_TIME = 5000;
10
+ export declare const PIPE_WAIT_TIME = 200;
11
+ export declare const PIPE_MAX_CHUNK = 50;
@@ -0,0 +1,5 @@
1
+ import { ICreateLoggerOptions, ISlsLogger, ILogSender } from '../types';
2
+ /**
3
+ * 创建 Logger 方法
4
+ */
5
+ export default function createLogger(sender: ILogSender, options: ICreateLoggerOptions): ISlsLogger;
@@ -0,0 +1,7 @@
1
+ import { ILogSender, ICreateLogger, IGenerateCreateLoggerOptions } from '../types';
2
+ /**
3
+ * 创建 `createLogger` 方法的方法,对期望扩展默认参数的场景做了规范。
4
+ *
5
+ * 一般不会在项目中直接使用,而是用来写可复用 npm 包。
6
+ */
7
+ export default function generateCreateLogger(sender: ILogSender, { defaultParams: factoryDefaultParams, shouldIgnore: factoryShouldIgnore }: IGenerateCreateLoggerOptions): ICreateLogger;
@@ -0,0 +1,3 @@
1
+ export { default } from './factory/create-logger';
2
+ export { default as generateCreateLoggerBase } from './factory/generate-create-logger';
3
+ export type { ICreateLogger as CreateLogger, ICreateLoggerOptions as CreateLoggerOptions, IGenerateCreateLoggerOptions as GenerateCreateLoggerOptions, ISlsLogger as SlsLogger, ISlsLogOptions as SlsLogOptions, ISlsLogOptionsQuick as SlsLogOptionsQuick, ISlsPostBody as SlsPostBody } from './types';
@@ -0,0 +1,32 @@
1
+ export interface IDefaultParams {
2
+ (): Record<string, unknown>;
3
+ }
4
+ export type TDefaultParams = Record<string, unknown> | IDefaultParams;
5
+ export interface IShouldIgnore {
6
+ (): void | boolean;
7
+ }
8
+ /**
9
+ * 真正发送请求的实现逻辑(以支持多平台的需求),注意必需用 POST
10
+ */
11
+ export interface ILogSender {
12
+ (trackUrl: string, body: string, headers: Record<string, string>): void;
13
+ }
14
+ /**
15
+ * 用于在 flattenObject 的时候忽略部分属性
16
+ *
17
+ * - 默认忽略所有以 `_` 为前缀的属性
18
+ * - `string` 等于 `key` 则忽略
19
+ * - `string[]` 包含 `key` 则忽略
20
+ * - 方法,可用 `path` 进行判断(注意这里的 `path` 和 `prefix` 没有关系)
21
+ */
22
+ export type TFlattenIgnore = string | string[] | {
23
+ (key: string, value: unknown, path: string): boolean;
24
+ };
25
+ export interface ISlsLogPayload {
26
+ __topic__: string;
27
+ [k: string]: unknown;
28
+ }
29
+ export interface ISlsPostBody {
30
+ __topic__: string;
31
+ __logs__: Record<string, string>[];
32
+ }
@@ -0,0 +1,30 @@
1
+ import { ICreateLoggerOptions, ISlsLogOptionsQuick, ISlsLogOptions } from './options';
2
+ export type TLogArgs = [string, Record<string, unknown>?] | [ISlsLogOptions, string, Record<string, unknown>?];
3
+ export type TLogQuickArgs = [string, Record<string, unknown>?] | [ISlsLogOptionsQuick, string, Record<string, unknown>?];
4
+ export interface ISlsLogFn {
5
+ (topic: string): void;
6
+ <P extends object>(topic: string, payload: P): void;
7
+ (options: ISlsLogOptions, topic: string): void;
8
+ <P extends object>(options: ISlsLogOptions, topic: string, payload: P): void;
9
+ }
10
+ export interface ISlsLogFnQuick {
11
+ (topic: string): void;
12
+ <P extends object>(topic: string, payload: P): void;
13
+ (options: ISlsLogOptionsQuick, topic: string): void;
14
+ <P extends object>(options: ISlsLogOptionsQuick, topic: string, payload: P): void;
15
+ }
16
+ export interface ISlsLogger {
17
+ (topic: string): void;
18
+ <P extends object>(topic: string, payload: P): void;
19
+ (options: ISlsLogOptions, topic: string): void;
20
+ <P extends object>(options: ISlsLogOptions, topic: string, payload: P): void;
21
+ debug: ISlsLogFnQuick;
22
+ log: ISlsLogFnQuick;
23
+ info: ISlsLogFnQuick;
24
+ warn: ISlsLogFnQuick;
25
+ error: ISlsLogFnQuick;
26
+ fatal: ISlsLogFnQuick;
27
+ }
28
+ export interface ICreateLogger {
29
+ (options: ICreateLoggerOptions): ISlsLogger;
30
+ }
@@ -0,0 +1,3 @@
1
+ export * from './common';
2
+ export * from './options';
3
+ export * from './factory';
@@ -0,0 +1,123 @@
1
+ import { TDefaultParams, IShouldIgnore, TFlattenIgnore } from './common';
2
+ export interface ISlsPipeOptions {
3
+ trackUrl: string;
4
+ /**
5
+ * 不知所谓的参数,但必需,说是保留字段,默认 `0.6.0`(文档中的版本号),请不要使用
6
+ */
7
+ apiVersion: string;
8
+ /**
9
+ * 应用初始化后,多少时间内对日志请求进行冷冻处理,以让行业务请求,提升业务性能
10
+ *
11
+ * 默认 5000ms
12
+ */
13
+ silentTime: number;
14
+ /**
15
+ * 调用方法到日志被真正发送的等待时间,这段时间内,若有新的日志进来,会被合并并重新计时
16
+ *
17
+ * 默认 200ms
18
+ */
19
+ waitTime: number;
20
+ /**
21
+ * 一次最多发送日志条数,若积累的日志数超过,将切成多个请求发送
22
+ *
23
+ * 默认 50
24
+ */
25
+ maxChunk: number;
26
+ }
27
+ export interface ICreateLoggerOptions extends Partial<ISlsPipeOptions> {
28
+ /**
29
+ * logstore 所在的 SLS project
30
+ */
31
+ project: string;
32
+ /**
33
+ * project 的外网访问域名,在 SLS 控制台 project 概览页可以找到,
34
+ * 如 `cn-hangzhou.log.aliyuncs.com`(仅跟 project 所在地域有关)
35
+ */
36
+ endpoint: string;
37
+ /**
38
+ * SLS project 下的 logstore,必须开通 Web Tracking 功能,日志记录的存储点
39
+ */
40
+ logstore: string;
41
+ /**
42
+ * 当希望同一个模块的日志使用统一的前缀,又不想每次调用的时候写,可以用这个
43
+ */
44
+ topicPrefix?: string;
45
+ /**
46
+ * 生产出的日志方法的整体采样率,可在调用时由方法参数覆盖,范围为 (0, 1],默认 1
47
+ */
48
+ sampling?: number;
49
+ /**
50
+ * 默认参数,避免每次都要传,可以是静态数据或产生动态数据的方法,这些参数可以覆盖自动记录的参数,
51
+ * 但会被日志方法的第二个参数 `params` 中对应的字段覆盖
52
+ */
53
+ defaultParams?: TDefaultParams;
54
+ /**
55
+ * 上报之前进行判断是否继续,返回 false 以阻止上报
56
+ *
57
+ * 在某些场景下需要禁用日志上报功能,比如国外禁止将日志上报到国内的 logstore
58
+ */
59
+ shouldIgnore?: IShouldIgnore;
60
+ }
61
+ /**
62
+ * 生成 `createLogger` 方法的工厂方法的 options,用于制定工厂级别的参数的忽略方法
63
+ */
64
+ export interface IGenerateCreateLoggerOptions {
65
+ defaultParams?: TDefaultParams;
66
+ shouldIgnore?: IShouldIgnore;
67
+ }
68
+ export interface ISlsFlattenOptions {
69
+ prefix?: string;
70
+ depth?: number;
71
+ ignore?: TFlattenIgnore;
72
+ }
73
+ /**
74
+ * SLS 日志方法 Options
75
+ */
76
+ export interface ISlsLogOptions {
77
+ /**
78
+ * 覆盖 IFactoryOptions 的 topicPrefix 设置,仅针对当前日志
79
+ */
80
+ topicPrefix?: string;
81
+ /**
82
+ * 覆盖 IFactoryOptions 的 sampling 设置,仅针对当前日志
83
+ */
84
+ sampling?: number;
85
+ /**
86
+ * 有日志只需要在应用起来后记录一次,后续的将被丢弃
87
+ *
88
+ * - true 表示以该 topic 做判断,针对该 topic 只记录一次
89
+ * - 如果是字符串,则以「topic + 此字符串」做判断
90
+ */
91
+ once?: true | string;
92
+ /**
93
+ * 日志不是强需求,不能压过业务,要业务先行。网络请求一般在页面的一开始最密集,如果日志在这时上报会造成网络阻塞而产生性能问题。
94
+ *
95
+ * 办法是先积压着,等到时间到了,再把积压着的日志一起上报。
96
+ *
97
+ * 所以,为了提升性能,做了以下事情:
98
+ *
99
+ * 1. 应用起来后,有一定的静默时间,这段时间的日志会被积压,用于给应用的请求让路
100
+ * 2. 整体或单个日志的延时时间
101
+ * 3. 整体或单个日志的采样率
102
+ * 4. 有的日志只会发送一次
103
+ * 5. 日志发送前也有一个很短的等待时间,在这段时间内,如果有新的日志进来,也将被积压,并重新计时
104
+ * 6. 最后,积压的日志利用 POST 请求对日志进行合并发送
105
+ *
106
+ * 然而,总有例外,有的日志希望是即时的,比如需要拿它来算 PvUv,instant 就是为此而生。
107
+ * 注意:instant 会忽略延时,但不会忽略采样率
108
+ */
109
+ instant?: boolean;
110
+ /**
111
+ * 是否对 info 进行 flatten 操作
112
+ */
113
+ flatten?: boolean | string | ISlsFlattenOptions;
114
+ /**
115
+ * 为日志增加默认参数 `_GROUP`,可用于数据分析分组
116
+ */
117
+ group?: string;
118
+ }
119
+ /**
120
+ * SLS 快捷方法 Options
121
+ */
122
+ export interface ISlsLogOptionsQuick extends Omit<ISlsLogOptions, 'group'> {
123
+ }
@@ -0,0 +1,8 @@
1
+ import type { ISlsLogPayload, ISlsPostBody } from '../types';
2
+ /**
3
+ * 利用 PutWebTracking 发送日志,如果 `__logs__` 里含有 `__topic__` 则,外部的这个 `__topic__` 将被改为 `__topic__0`,
4
+ * 为了干净,在仅发送一条日志的时候,将 `__logs__` 里的 `__topic__` 往上提。
5
+ *
6
+ * 但是,POST 的时候 `__source__` 不会被默认填充成 IP,IP 在 `__tag__:__client_ip__`(GET 方式也有)
7
+ */
8
+ export default function buildPostBody(payloads: ISlsLogPayload[]): ISlsPostBody;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Error 身上的 name、message、stack 等信息用 _forEach 遍历不到,故需要转成普通对象
3
+ */
4
+ export default function convertErrorToPlain(err: Error): Record<string, unknown>;
@@ -0,0 +1,8 @@
1
+ import type { ISlsLogPayload } from '../types';
2
+ /**
3
+ * 发送的 JSON 里边不可以有除了字符串以外的值,否则报错
4
+ *
5
+ * - code = PostBodyInvalid
6
+ * - message = Value in log is not string data type
7
+ */
8
+ export default function convertLogInfo(info: ISlsLogPayload): Record<string, string>;
@@ -0,0 +1,2 @@
1
+ import { ISlsLogFn, ISlsLogFnQuick } from '../types';
2
+ export default function createSlsLogQuick(sls: ISlsLogFn, group: string): ISlsLogFnQuick;
@@ -0,0 +1,13 @@
1
+ import type { ISlsFlattenOptions } from '../types';
2
+ /**
3
+ * 有时候为了统计方便,需要把传入的对象展平,比如 error 对象,可能会展平成如下形状:
4
+ *
5
+ * ```
6
+ * {
7
+ * "error.name": "..",
8
+ * "error.message": "..",
9
+ * "error.stack": ".."
10
+ * }
11
+ * ```
12
+ */
13
+ export default function flattenObject<T extends object>(o: T, options: string | ISlsFlattenOptions): Record<string, unknown>;
@@ -0,0 +1,2 @@
1
+ import type { ISlsFlattenOptions } from '../types';
2
+ export default function flattenShouldIgnore(ignore: ISlsFlattenOptions['ignore'], path: string, key: string, value: unknown): boolean;
@@ -0,0 +1 @@
1
+ export default function getLogOnceKey(topic: string, once?: true | string): string | undefined;
@@ -0,0 +1 @@
1
+ export default function getSilentCountdown(silentTime: number): number;
@@ -0,0 +1,9 @@
1
+ export { default as getSilentCountdown } from './get-silent-countdown';
2
+ export { default as getLogOnceKey } from './get-log-once-key';
3
+ export { default as flattenObject } from './flatten-object';
4
+ export { default as buildPostBody } from './build-post-body';
5
+ export { default as convertErrorToPlain } from './convert-error-to-plain';
6
+ export { default as resolveDefaultParams } from './resolve-default-params';
7
+ export { default as createSlsLogQuick } from './create-sls-log-quick';
8
+ export { default as mergeDefaultParams } from './merge-default-params';
9
+ export { default as mergeShouldIgnore } from './merge-should-ignore';
@@ -0,0 +1,5 @@
1
+ import type { TDefaultParams } from '../types';
2
+ /**
3
+ * 合并默认参数
4
+ */
5
+ export default function mergeDefaultParams(factoryDefaultParams?: TDefaultParams, defaultParams?: TDefaultParams): TDefaultParams | undefined;
@@ -0,0 +1,2 @@
1
+ import type { IShouldIgnore } from '../types';
2
+ export default function mergeShouldIgnore(factoryShouldIgnore?: IShouldIgnore, shouldIgnore?: IShouldIgnore): IShouldIgnore | undefined;
@@ -0,0 +1,2 @@
1
+ import { TDefaultParams } from '../types';
2
+ export default function resolveDefaultParams(defaultParams?: TDefaultParams): Record<string, unknown> | undefined;
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@kcuf/sls-logger-base",
3
+ "version": "0.0.1",
4
+ "description": "Aliyun SLS logger without transport implementation.",
5
+ "keywords": [],
6
+ "license": "MIT",
7
+ "sideEffects": false,
8
+ "main": "dist/cjs/index.js",
9
+ "module": "dist/esm/index.js",
10
+ "types": "dist/types/index.d.ts",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/justnewbee/kcuf.git"
14
+ },
15
+ "homepage": "https://github.com/justnewbee/kcuf/tree/master/packages-fetcher/sls-logger-base",
16
+ "bugs": "https://github.com/justnewbee/kcuf/issues",
17
+ "author": {
18
+ "name": "Jianchun Wang",
19
+ "email": "justnewbee@gmail.com"
20
+ },
21
+ "publishConfig": {
22
+ "access": "public"
23
+ },
24
+ "devDependencies": {
25
+ "@babel/cli": "^7.25.6",
26
+ "@babel/core": "^7.25.2",
27
+ "@babel/plugin-transform-runtime": "^7.25.4",
28
+ "@babel/preset-env": "^7.25.4",
29
+ "@babel/preset-typescript": "^7.24.7",
30
+ "@types/lodash": "^4.17.7",
31
+ "@vitest/coverage-v8": "^2.1.1",
32
+ "fetch-mock": "^11.1.4",
33
+ "jsdom": "^25.0.0",
34
+ "rimraf": "^6.0.1",
35
+ "typescript": "^5.6.2",
36
+ "vitest": "^2.1.1",
37
+ "@kcuf/ts-config": "^0.0.1"
38
+ },
39
+ "peerDependencies": {
40
+ "@babel/runtime": "^7.24.8"
41
+ },
42
+ "dependencies": {
43
+ "lodash": "^4.17.21"
44
+ },
45
+ "scripts": {
46
+ "build:clean": "rimraf dist",
47
+ "build:esm": "ESM=1 babel src -d dist/esm --extensions .ts,.tsx --source-maps",
48
+ "build:cjs": "ESM=0 babel src -d dist/cjs --extensions .ts,.tsx",
49
+ "build:types": "tsc -rootDir src --outDir dist/types --declaration --noEmit false --emitDeclarationOnly --isolatedModules false",
50
+ "build": "pnpm build:esm && pnpm build:cjs && pnpm build:types",
51
+ "watch": "pnpm build:esm -w",
52
+ "test": "vitest",
53
+ "test:cov": "vitest --coverage --coverage.include=src"
54
+ }
55
+ }