@esmx/class-state 3.0.0-rc.18 → 3.0.0-rc.20

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2020 Vanelink
3
+ Copyright (c) 2020 Esmx Team
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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)
@@ -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)
@@ -194,6 +194,7 @@ test("Multiple instances", () => {
194
194
  }
195
195
  }
196
196
  const user = _connectStore(User, "user");
197
+ const blog = _connectStore(Blog, "blog");
197
198
  user.$setName("jack");
198
199
  user.blog.$setText("hello world.");
199
200
  assert.strictEqual(user.name, "jack");
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.18",
37
- "@gez/lint": "3.0.0-rc.9",
38
- "@types/node": "22.13.10",
39
- "@vitest/coverage-v8": "3.0.8",
36
+ "@esmx/lint": "3.0.0-rc.20",
37
+ "@types/node": "22.15.18",
38
+ "@vitest/coverage-v8": "3.1.3",
40
39
  "@vue/compiler-dom": "^3.5.13",
41
- "stylelint": "16.15.0",
40
+ "stylelint": "16.19.1",
42
41
  "typescript": "5.8.2",
43
- "unbuild": "2.0.0",
44
- "vitest": "3.0.8",
42
+ "unbuild": "3.5.0",
43
+ "vitest": "3.1.3",
45
44
  "vue": "^3.5.13"
46
45
  },
47
- "version": "3.0.0-rc.18",
46
+ "version": "3.0.0-rc.20",
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": "79ceb323f985dd88dbd7f1349f61f341b6d522c4"
65
+ "gitHead": "4c6490c23cbc148cb189b3f2cdae930eed901607"
67
66
  }
@@ -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.');