@k-msg/template 0.15.0 → 0.17.0

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,7 +1,7 @@
1
1
  /**
2
2
  * Template Registry - Manages templates across providers and categories
3
3
  */
4
- import { EventEmitter } from "events";
4
+ import { EventEmitter } from "../shared/event-emitter";
5
5
  import type { AlimTalkTemplate, TemplateCategory, TemplateStatus } from "../types/template.types";
6
6
  export interface TemplateSearchFilters {
7
7
  provider?: string;
@@ -63,7 +63,6 @@ export interface TemplateRegistryOptions {
63
63
  enableValidationOnRegister: boolean;
64
64
  }
65
65
  export declare class TemplateRegistry extends EventEmitter {
66
- private options;
67
66
  private templates;
68
67
  private templatesByCode;
69
68
  private templatesByProvider;
@@ -72,6 +71,7 @@ export declare class TemplateRegistry extends EventEmitter {
72
71
  private usageStats;
73
72
  private backupTimer?;
74
73
  private defaultOptions;
74
+ private options;
75
75
  constructor(options?: Partial<TemplateRegistryOptions>);
76
76
  /**
77
77
  * Register a new template
@@ -0,0 +1,15 @@
1
+ type Listener = (...args: unknown[]) => void;
2
+ /**
3
+ * Minimal event emitter implementation for runtime-neutral (Edge/Web) usage.
4
+ */
5
+ export declare class EventEmitter {
6
+ private listenersMap;
7
+ on(eventName: string, listener: Listener): this;
8
+ addListener(eventName: string, listener: Listener): this;
9
+ off(eventName: string, listener: Listener): this;
10
+ removeListener(eventName: string, listener: Listener): this;
11
+ once(eventName: string, listener: Listener): this;
12
+ emit(eventName: string, ...args: unknown[]): boolean;
13
+ removeAllListeners(eventName?: string): this;
14
+ }
15
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k-msg/template",
3
- "version": "0.15.0",
3
+ "version": "0.17.0",
4
4
  "packageManager": "bun@1.3.8",
5
5
  "description": "AlimTalk template engine for parsing, building and managing templates",
6
6
  "type": "module",
@@ -18,24 +18,23 @@
18
18
  "access": "public"
19
19
  },
20
20
  "scripts": {
21
- "build": "bun run build:esm && bun run build:cjs && bun run build:types",
21
+ "build": "bun run clean && bun run build:esm && bun run build:cjs && bun run build:types",
22
22
  "build:esm": "bun build ./src/index.ts --outdir ./dist --format esm --minify --sourcemap --entry-naming '[name].mjs' --external 'bun:test'",
23
23
  "build:cjs": "bun build ./src/index.ts --outdir ./dist --format cjs --minify --sourcemap --entry-naming '[name].js' --external 'bun:test'",
24
24
  "build:types": "tsc",
25
25
  "dev": "tsc --watch",
26
26
  "test": "bun test",
27
- "clean": "rm -rf dist",
27
+ "clean": "rm -rf dist tsconfig.tsbuildinfo",
28
28
  "pack": "bun pm pack",
29
29
  "publish": "bun publish --access public"
30
30
  },
31
31
  "dependencies": {
32
- "@k-msg/core": "0.15.0",
32
+ "@k-msg/core": "0.17.0",
33
33
  "zod": "^4.0.14"
34
34
  },
35
35
  "devDependencies": {
36
36
  "typescript": "^5.7.2",
37
- "@types/bun": "latest",
38
- "@types/node": "^22.0.0"
37
+ "@types/bun": "^1.3.9"
39
38
  },
40
39
  "keywords": [
41
40
  "alimtalk",