chore: release v1.0.14 with component-based refactor and updated docs By: AICoder

This commit is contained in:
AI Engineer 2026-06-11 13:58:22 +08:00
parent 402863fba8
commit 8a4a10f283
4 changed files with 25 additions and 3 deletions

View File

@ -1,5 +1,15 @@
# Changelog
## [1.0.18] - 2026-06-11
### Changed
- **Component-Based Refactor**: Reorganized source code into independent, PascalCase named modules (e.g., `AutoForm.js`, `TagsInput.js`, `List.js`) to improve maintainability.
- **De-ESM Architecture**: Eliminated internal ESM `import`/`export` dependencies between modules. Logic is now shared via `globalThis` and registration patterns, ensuring 100% UMD compatibility.
- **Improved Encapsulation**: Each component is now a self-contained unit responsible for its own registration and internal logic.
- **Global API Consistency**: Ensured all public APIs (`HTTP`, `UI`, `AutoForm`, etc.) are consistently mounted to `globalThis`.
### Fixed
- **Scope Initialization**: Fixed a critical `TypeError` in `DatePicker` and `TagsInput` by refining parent scope inheritance and preventing recursive self-parenting in the underlying `state` engine.
## [1.0.13] - 2026-06-08
### Fixed
- **State Integration**: Bumped `@apigo.cc/state` to `1.0.18` to restore the globally injected `$`/`$$` helpers from the original UMD era, fixing `TagsInput` element targeting.

View File

@ -8,6 +8,8 @@
### 同步 UMD 集成 (推荐:消灭异步时序风险,实现“秒开”渲染)
将脚本放置在 `<head>` 中,确保地基在 DOM 解析前就绪:
**本地引入示例:**
```html
<!-- 1. 基础状态机 (地基) -->
<script src="dist/lib/state.js"></script>
@ -15,7 +17,17 @@
<script src="dist/lib/bootstrap.js"></script>
<!-- 3. 本业务组件库 -->
<script src="dist/lib/base.js"></script>
```
**CDN 引入示例:**
```html
<!-- 1. 基础状态机 (地基) -->
<script src="https://cdn.jsdelivr.net/npm/@apigo.cc/state@1.0.18/dist/state.min.js"></script>
<!-- 2. Bootstrap 适配层 -->
<script src="https://cdn.jsdelivr.net/npm/@apigo.cc/bootstrap@1.0.7/dist/bootstrap.min.js"></script>
<!-- 3. 本业务组件库 -->
<script src="https://cdn.jsdelivr.net/npm/@apigo.cc/base@1.0.18/dist/base.min.js"></script>
```
<script>
// 4. 数据先行 (在 body 解析前定义)
window.brand = { label: 'My App' };

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "@apigo.cc/base",
"version": "1.0.7",
"version": "1.0.18",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@apigo.cc/base",
"version": "1.0.7",
"version": "1.0.18",
"devDependencies": {
"@playwright/test": "^1.40.0",
"@rollup/plugin-terser": "^1.0.0",

View File

@ -1,6 +1,6 @@
{
"name": "@apigo.cc/base",
"version": "1.0.13",
"version": "1.0.18",
"type": "module",
"main": "dist/base.js",
"files": [