@ticatec/restful_service_api 0.3.0 → 0.5.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.
Files changed (3) hide show
  1. package/README-CN.md +28 -0
  2. package/README.md +27 -0
  3. package/package.json +3 -2
package/README-CN.md CHANGED
@@ -18,6 +18,34 @@
18
18
  - 🌐 **浏览器优先**: 专为前端应用程序设计
19
19
  - ✨ **PATCH 支持**: 完整支持 HTTP PATCH 方法进行部分更新
20
20
 
21
+ ## ⚠️ v0.5.0 重大变更
22
+
23
+ **从 0.5.0 版本开始,此包已迁移到 ESM (ECMAScript Modules) 格式。**
24
+
25
+ ### 对您的影响
26
+
27
+ - 您的项目必须使用 ESM 格式(package.json 中包含 `"type": "module"` 或使用 `.mjs` 扩展名)
28
+ - 不再支持 `require()`,请使用 `import` 语句
29
+
30
+ ### 迁移指南
31
+
32
+ 如果您正在从 0.5.0 之前的版本升级:
33
+
34
+ **之前 (CommonJS):**
35
+ ```javascript
36
+ const RestService = require('@ticatec/restful_service_api');
37
+ ```
38
+
39
+ **之后 (ESM):**
40
+ ```typescript
41
+ import RestService from '@ticatec/restful_service_api';
42
+ ```
43
+
44
+ 对于 CommonJS 项目,您可能需要使用动态导入:
45
+ ```javascript
46
+ const { default: RestService } = await import('@ticatec/restful_service_api');
47
+ ```
48
+
21
49
  ## 安装
22
50
 
23
51
  ```bash
package/README.md CHANGED
@@ -18,6 +18,33 @@ A lightweight TypeScript RESTful API client for browsers with comprehensive erro
18
18
  - 🌐 **Browser-First**: Designed specifically for frontend applications
19
19
  - ✨ **PATCH Support**: Full support for HTTP PATCH method for partial updates
20
20
 
21
+ ## ⚠️ Breaking Changes in v0.5.0
22
+
23
+ **Starting from version 0.5.0, this package has migrated to ESM (ECMAScript Modules) format.**
24
+
25
+ ### What This Means for You
26
+
27
+ - Your project must use ESM format (have `"type": "module"` in package.json or use `.mjs` extension)
28
+ - `require()` is no longer supported. Use `import` statements instead
29
+ ### Migration Guide
30
+
31
+ If you're upgrading from a version prior to 0.5.0:
32
+
33
+ **Before (CommonJS):**
34
+ ```javascript
35
+ const RestService = require('@ticatec/restful_service_api');
36
+ ```
37
+
38
+ **After (ESM):**
39
+ ```typescript
40
+ import RestService from '@ticatec/restful_service_api';
41
+ ```
42
+
43
+ For CommonJS projects, you may need to use dynamic import:
44
+ ```javascript
45
+ const { default: RestService } = await import('@ticatec/restful_service_api');
46
+ ```
47
+
21
48
  ## Installation
22
49
 
23
50
  ```bash
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
+ "type": "module",
2
3
  "name": "@ticatec/restful_service_api",
3
- "version": "0.3.0",
4
- "description": "A lightweight TypeScript RESTful API client for browsers with error handling.",
4
+ "version": "0.5.0",
5
+ "description": "A lightweight TypeScript RESTful API client for browsers with error handling. (ESM only, v0.5.0+)",
5
6
  "main": "dist/index.js",
6
7
  "module": "dist/index.js",
7
8
  "types": "dist/index.d.ts",