lichta 2.0.1 → 2.2.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.
package/README.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # lichta (legacy)
2
2
 
3
- [![npm version](https://img.shields.io/npm/v/lichta.svg)](https://www.npmjs.com/package/lichta)
3
+ [![lichta](https://img.shields.io/npm/v/lichta.svg?label=lichta)](https://www.npmjs.com/package/lichta)
4
+ [![@lichta/core](https://img.shields.io/npm/v/@lichta/core.svg?label=%40lichta%2Fcore)](https://www.npmjs.com/package/@lichta/core)
5
+
6
+ 🚀 **[Demo trực tiếp](https://lichta.zeneo.app/)**
4
7
 
5
8
  > ⚠️ **Package này đã deprecated.** Đây là tên npm cũ của thư viện trước khi đổi sang các package có scope `@lichta/*`. Đừng cài package này cho dự án mới — xem bảng bên dưới để chọn đúng package thay thế.
6
9
 
@@ -8,19 +11,20 @@
8
11
 
9
12
  Trước đây toàn bộ thư viện được publish dưới 1 package tên `lichta` duy nhất. Từ khi tách thành monorepo với các package scoped (`@lichta/core`, `@lichta/react`, `@lichta/vue`, `@lichta/svelte`, `@lichta/full-calendar`, `@lichta/event-calendar`, `@lichta/react-big-calendar`), package `lichta` được giữ lại làm cầu nối tương thích ngược cho những dự án đang cài `lichta` từ trước, tránh vỡ code đột ngột khi họ chạy `npm update`.
10
13
 
11
- ## Trạng thái hiện tại
14
+ ## Trạng thái hiện tại (từ v2.2.0)
12
15
 
13
- **Package này hiện chỉ re-export `@lichta/svelte`:**
16
+ **Package này giờ chỉ re-export `@lichta/core`** (vanilla JS/TS, không phụ thuộc framework nào):
14
17
 
15
18
  ```javascript
16
19
  // index.js
17
- console.warn("[lichta] WARNING: The 'lichta' package is deprecated for Svelte components. ...");
18
- export * from '@lichta/svelte';
20
+ export * from '@lichta/core';
19
21
  ```
20
22
 
21
23
  Nghĩa là:
22
- - Nếu bạn đang dùng Svelte, `import { ... } from 'lichta'` vẫn hoạt động (thực chất là `@lichta/svelte`), nhưng sẽ in cảnh báo deprecation ra console.
23
- - Nếu bạn dùng React, Vue, hoặc chỉ cần logic tính toán thuần (vanilla JS/TS) — package này **không có đường dẫn tương thích cho bạn**, chỉ trỏ tới `@lichta/svelte`. Cài `lichta` trong trường hợp này sẽ kéo theo `svelte` như một dependency dù bạn không dùng Svelte.
24
+ - `import { LichTa } from 'lichta'` hoạt động tương đương `import { LichTa } from '@lichta/core'` không kéo theo `react`/`vue`/`svelte` như một dependency bạn không dùng.
25
+ - Nếu bạn cần component UI (Calendar/DatePicker) cho React, Vue, hoặc Svelte — package này **không có đường dẫn tương thích cho bạn**, cài thẳng package framework tương ứng bên dưới.
26
+
27
+ > ⚠️ **Breaking change so với các bản trước v2.2.0**: trước đây `lichta` re-export `@lichta/svelte` (kèm cảnh báo deprecation). Nếu bạn đang dùng `import { Calendar } from 'lichta'` để lấy Svelte component, migrate sang `@lichta/svelte`.
24
28
 
25
29
  ## Nên làm gì
26
30
 
@@ -36,7 +40,7 @@ Nghĩa là:
36
40
  | EventCalendar | [`@lichta/event-calendar`](https://www.npmjs.com/package/@lichta/event-calendar) |
37
41
  | React Big Calendar | [`@lichta/react-big-calendar`](https://www.npmjs.com/package/@lichta/react-big-calendar) |
38
42
 
39
- Nếu bạn đang cài `lichta` từ trước và dùng API core (`LichTa.toLunar()`, ...), chuyển sang `@lichta/core` API không đổi, chỉ đổi tên import:
43
+ Nếu bạn đang cài `lichta` từ trước và dùng API core (`LichTa.toLunar()`, ...), không cần đổi gì — `lichta` giờ chính `@lichta/core`. Khuyến nghị đổi tên import cho rõ ràng:
40
44
 
41
45
  ```diff
42
46
  - import { LichTa } from 'lichta';
package/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from '@lichta/svelte';
1
+ export * from '@lichta/core';
package/index.js CHANGED
@@ -1,3 +1 @@
1
- console.warn("[lichta] WARNING: The 'lichta' package is deprecated for Svelte components. It will become a pure Vanilla JS core in v3.0.0. Please migrate to '@lichta/svelte' if you are using Svelte.");
2
-
3
- export * from '@lichta/svelte';
1
+ export * from '@lichta/core';
package/package.json CHANGED
@@ -1,16 +1,14 @@
1
1
  {
2
2
  "name": "lichta",
3
- "version": "2.0.1",
3
+ "version": "2.2.0",
4
4
  "description": "LichTa - Thư viện lịch Âm Dương Việt Nam (Tương thích ngược)",
5
5
  "author": "Zeforc Labs | Stridev",
6
6
  "license": "MIT",
7
7
  "type": "module",
8
- "svelte": "./index.js",
9
8
  "types": "./index.d.ts",
10
9
  "exports": {
11
10
  ".": {
12
11
  "types": "./index.d.ts",
13
- "svelte": "./index.js",
14
12
  "default": "./index.js"
15
13
  }
16
14
  },
@@ -20,7 +18,7 @@
20
18
  "LICENSE"
21
19
  ],
22
20
  "dependencies": {
23
- "@lichta/svelte": "2.0.1"
21
+ "@lichta/core": "2.2.0"
24
22
  },
25
23
  "repository": {
26
24
  "type": "git",