@x-edu/service 0.0.11 → 0.0.13
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 +38 -0
- package/package.json +9 -4
package/README.md
CHANGED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# @x-edu/service
|
|
2
|
+
x 学习相关 API
|
|
3
|
+
|
|
4
|
+
## 安装
|
|
5
|
+
```bash
|
|
6
|
+
npm i @x-edu/service
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## 示例
|
|
10
|
+
```js service.js
|
|
11
|
+
import Service from '@x-edu/service'
|
|
12
|
+
|
|
13
|
+
export let service
|
|
14
|
+
|
|
15
|
+
export function initService({
|
|
16
|
+
uc,
|
|
17
|
+
sdpAppId
|
|
18
|
+
}) {
|
|
19
|
+
service = new Service({
|
|
20
|
+
uc,
|
|
21
|
+
sdpAppId
|
|
22
|
+
})
|
|
23
|
+
return service
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```js app.js
|
|
28
|
+
const uc = new UC()
|
|
29
|
+
const sdpAppI = 'xxxx'
|
|
30
|
+
|
|
31
|
+
initService({ uc, sdpAppId })
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```js biz.js
|
|
35
|
+
import { service as serviceInstance } from '@/service'
|
|
36
|
+
|
|
37
|
+
serviceInstance.service.xxx()
|
|
38
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x-edu/service",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
|
+
"description": "x学习服务",
|
|
5
|
+
"repository": "https://gitlab.ndaeweb.com/x-edu/x-edu-sdk",
|
|
6
|
+
"author": "郭延豪(708674)",
|
|
4
7
|
"main": "dist/service.js",
|
|
5
8
|
"module": "dist/service.mjs",
|
|
6
9
|
"types": "dist/index.d.ts",
|
|
@@ -21,7 +24,8 @@
|
|
|
21
24
|
"clean": "rimraf dist node_modules",
|
|
22
25
|
"release": "release-it",
|
|
23
26
|
"beforepublish": "node ../../scripts/publish_backup.js",
|
|
24
|
-
"afterpublish": "node ../../scripts/publish_recover.js"
|
|
27
|
+
"afterpublish": "node ../../scripts/publish_recover.js",
|
|
28
|
+
"postpublish": "xem publish"
|
|
25
29
|
},
|
|
26
30
|
"publishConfig": {
|
|
27
31
|
"access": "public",
|
|
@@ -46,6 +50,7 @@
|
|
|
46
50
|
},
|
|
47
51
|
"devDependencies": {
|
|
48
52
|
"@types/node": "^18.15.13",
|
|
53
|
+
"@x-edu/material-cli": "^0.0.3",
|
|
49
54
|
"husky": "^7.0.4",
|
|
50
55
|
"lint-staged": "^7.3.0",
|
|
51
56
|
"vite": "^5.1.4",
|
|
@@ -57,7 +62,7 @@
|
|
|
57
62
|
"vite-plugin-inspect": "^0.8.4"
|
|
58
63
|
},
|
|
59
64
|
"peerDependencies": {
|
|
60
|
-
"react": "^17.0.0 || ^18.0.0",
|
|
61
|
-
"react-dom": "^17.0.0 || ^18.0.0"
|
|
65
|
+
"react": "^16.0.0 || ^17.0.0 || ^18.0.0",
|
|
66
|
+
"react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0"
|
|
62
67
|
}
|
|
63
68
|
}
|