@esmx/class-state 3.0.0-rc.17 → 3.0.0-rc.19
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/LICENSE +1 -1
- package/README.md +51 -0
- package/README.zh-CN.md +51 -0
- package/dist/connect.test.mjs +1 -0
- package/package.json +8 -9
- package/src/connect.test.ts +2 -0
package/LICENSE
CHANGED
package/README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="https://www.esmnext.com/logo.svg?t=2025" width="120" alt="Esmx Logo" />
|
|
3
|
+
<h1>@esmx/class-state</h1>
|
|
4
|
+
|
|
5
|
+
<div>
|
|
6
|
+
<a href="https://www.npmjs.com/package/@esmx/class-state">
|
|
7
|
+
<img src="https://img.shields.io/npm/v/@esmx/class-state.svg" alt="npm version" />
|
|
8
|
+
</a>
|
|
9
|
+
<a href="https://github.com/esmnext/esmx/actions/workflows/build.yml">
|
|
10
|
+
<img src="https://github.com/esmnext/esmx/actions/workflows/build.yml/badge.svg" alt="Build" />
|
|
11
|
+
</a>
|
|
12
|
+
<a href="https://www.esmnext.com/coverage/">
|
|
13
|
+
<img src="https://img.shields.io/badge/coverage-live%20report-brightgreen" alt="Coverage Report" />
|
|
14
|
+
</a>
|
|
15
|
+
<a href="https://nodejs.org/">
|
|
16
|
+
<img src="https://img.shields.io/node/v/@esmx/class-state.svg" alt="node version" />
|
|
17
|
+
</a>
|
|
18
|
+
<a href="https://bundlephobia.com/package/@esmx/class-state">
|
|
19
|
+
<img src="https://img.shields.io/bundlephobia/minzip/@esmx/class-state" alt="size" />
|
|
20
|
+
</a>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<p>Lightweight class-based state management solution for modern JavaScript applications</p>
|
|
24
|
+
|
|
25
|
+
<p>
|
|
26
|
+
English | <a href="https://github.com/esmnext/esmx/blob/master/packages/class-state/README.zh-CN.md">中文</a>
|
|
27
|
+
</p>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
## 🚀 Features
|
|
31
|
+
|
|
32
|
+
- **Class-Based Design** - Clean and intuitive class-based state management
|
|
33
|
+
- **Framework Agnostic** - Works with any JavaScript framework or vanilla JS
|
|
34
|
+
- **TypeScript Ready** - Full TypeScript support with excellent type inference
|
|
35
|
+
- **Reactive System** - Built-in reactivity for automatic UI updates
|
|
36
|
+
- **Lightweight** - Minimal bundle size with maximum functionality
|
|
37
|
+
- **Modern API** - Uses modern JavaScript features and patterns
|
|
38
|
+
|
|
39
|
+
## 📦 Installation
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm install @esmx/class-state
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## 📚 Documentation
|
|
46
|
+
|
|
47
|
+
Visit the [official documentation](https://www.esmnext.com) for detailed usage guides and API reference.
|
|
48
|
+
|
|
49
|
+
## 📄 License
|
|
50
|
+
|
|
51
|
+
MIT © [Esmx Team](https://github.com/esmnext/esmx)
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="https://www.esmnext.com/logo.svg?t=2025" width="120" alt="Esmx Logo" />
|
|
3
|
+
<h1>@esmx/class-state</h1>
|
|
4
|
+
|
|
5
|
+
<div>
|
|
6
|
+
<a href="https://www.npmjs.com/package/@esmx/class-state">
|
|
7
|
+
<img src="https://img.shields.io/npm/v/@esmx/class-state.svg" alt="npm version" />
|
|
8
|
+
</a>
|
|
9
|
+
<a href="https://github.com/esmnext/esmx/actions/workflows/build.yml">
|
|
10
|
+
<img src="https://github.com/esmnext/esmx/actions/workflows/build.yml/badge.svg" alt="Build" />
|
|
11
|
+
</a>
|
|
12
|
+
<a href="https://www.esmnext.com/coverage/">
|
|
13
|
+
<img src="https://img.shields.io/badge/coverage-live%20report-brightgreen" alt="Coverage Report" />
|
|
14
|
+
</a>
|
|
15
|
+
<a href="https://nodejs.org/">
|
|
16
|
+
<img src="https://img.shields.io/node/v/@esmx/class-state.svg" alt="node version" />
|
|
17
|
+
</a>
|
|
18
|
+
<a href="https://bundlephobia.com/package/@esmx/class-state">
|
|
19
|
+
<img src="https://img.shields.io/bundlephobia/minzip/@esmx/class-state" alt="size" />
|
|
20
|
+
</a>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<p>为现代 JavaScript 应用提供的轻量级基于类的状态管理解决方案</p>
|
|
24
|
+
|
|
25
|
+
<p>
|
|
26
|
+
<a href="https://github.com/esmnext/esmx/blob/master/packages/class-state/README.md">English</a> | 中文
|
|
27
|
+
</p>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
## 🚀 特性
|
|
31
|
+
|
|
32
|
+
- **基于类的设计** - 简洁直观的基于类的状态管理
|
|
33
|
+
- **框架无关** - 适用于任何 JavaScript 框架或原生 JS
|
|
34
|
+
- **TypeScript 就绪** - 完整的 TypeScript 支持,出色的类型推断
|
|
35
|
+
- **响应式系统** - 内置响应性,自动更新 UI
|
|
36
|
+
- **轻量级** - 最小化包体积,最大化功能
|
|
37
|
+
- **现代 API** - 使用现代 JavaScript 特性和模式
|
|
38
|
+
|
|
39
|
+
## 📦 安装
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm install @esmx/class-state
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## 📚 文档
|
|
46
|
+
|
|
47
|
+
访问[官方文档](https://www.esmnext.com)获取详细的使用指南和 API 参考。
|
|
48
|
+
|
|
49
|
+
## 📄 许可证
|
|
50
|
+
|
|
51
|
+
MIT © [Esmx Team](https://github.com/esmnext/esmx)
|
package/dist/connect.test.mjs
CHANGED
package/package.json
CHANGED
|
@@ -33,18 +33,17 @@
|
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@biomejs/biome": "1.9.4",
|
|
36
|
-
"@esmx/lint": "3.0.0-rc.
|
|
37
|
-
"@
|
|
38
|
-
"@
|
|
39
|
-
"@vitest/coverage-v8": "3.0.8",
|
|
36
|
+
"@esmx/lint": "3.0.0-rc.19",
|
|
37
|
+
"@types/node": "22.15.18",
|
|
38
|
+
"@vitest/coverage-v8": "3.1.3",
|
|
40
39
|
"@vue/compiler-dom": "^3.5.13",
|
|
41
|
-
"stylelint": "16.
|
|
40
|
+
"stylelint": "16.19.1",
|
|
42
41
|
"typescript": "5.8.2",
|
|
43
|
-
"unbuild": "
|
|
44
|
-
"vitest": "3.
|
|
42
|
+
"unbuild": "3.5.0",
|
|
43
|
+
"vitest": "3.1.3",
|
|
45
44
|
"vue": "^3.5.13"
|
|
46
45
|
},
|
|
47
|
-
"version": "3.0.0-rc.
|
|
46
|
+
"version": "3.0.0-rc.19",
|
|
48
47
|
"type": "module",
|
|
49
48
|
"private": false,
|
|
50
49
|
"exports": {
|
|
@@ -63,5 +62,5 @@
|
|
|
63
62
|
"template",
|
|
64
63
|
"public"
|
|
65
64
|
],
|
|
66
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "83a9cfac4a91b2b54ac576e120bb4541f4cce9d6"
|
|
67
66
|
}
|
package/src/connect.test.ts
CHANGED
|
@@ -250,6 +250,8 @@ test('Multiple instances', () => {
|
|
|
250
250
|
}
|
|
251
251
|
|
|
252
252
|
const user = _connectStore(User, 'user');
|
|
253
|
+
// Create blog instance first before accessing it from user
|
|
254
|
+
const blog = _connectStore(Blog, 'blog');
|
|
253
255
|
|
|
254
256
|
user.$setName('jack');
|
|
255
257
|
user.blog.$setText('hello world.');
|