tms-auth 1.2.45 → 1.2.68

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 CHANGED
@@ -1,8 +1,16 @@
1
+ <!--
2
+ * @Author : cynthiali@chatlabs.com
3
+ * @Date : 2025-04-25 11:15:50
4
+ * @LastEditors : cynthiali@chatlabs.com
5
+ * @LastEditTime : 2025-05-21 15:35:50
6
+ * @FilePath : /tms-auth/README.md
7
+ -->
8
+
1
9
  # tms-auth
2
10
 
3
- ## Getting Started
11
+ ## 启动项目
4
12
 
5
- Install dependencies,
13
+ 安装依赖
6
14
 
7
15
  ```bash
8
16
  $ npm i
@@ -14,28 +22,70 @@ Start the dev server,
14
22
  $ npm start
15
23
  ```
16
24
 
17
- Build documentation,
25
+
18
26
 
19
27
  ```bash
20
- $ npm run docs:build
28
+ $ npm run dev
21
29
  ```
22
30
 
23
- Run test,
31
+ ### 本地调试
32
+
33
+ 1. 用 npm run dev 启动项目后
34
+ 2. 运行 npm link 或 yarn link
35
+ 3. 在本地的项目 A 中运行 npm link tms-auth 或 yarn link tms-auth 即可调试
36
+
37
+ #### 注意事项
38
+
39
+ ##### 提示 react 版本升级为 17 问题
40
+
41
+ 用 yarn link 和 yarn link tms-auth
42
+
43
+ ##### 当前项目修改的数据如遇到 link 失败问题
44
+
45
+ 1. 可以试试先把`本地的项目A`的 node_modules 删掉
46
+ 2. 再执行一下命令 npm link tms-auth --legacy-peer-deps 或 npm link tms-auth --force
47
+
48
+ ##### 若运行后项目 A 提示 css 文件引入问题
49
+
50
+ ###### 方案 1
51
+
52
+ 1. 把 @import '~tms-auth/index.css'; 改为 @import '~tms-auth/dist/index.css';
53
+
54
+ ###### 方案 2
55
+
56
+ 临时方案:直接在项目 A 中复制 CSS 文件 ​​,手动复制 tms-auth 的 CSS 文件到项目 A 中:
57
+
58
+ - 2.1 复制 node_modules/tms-auth/dist/index.css 到 src/assets/css/
59
+ - 2.2 在项目中导入:`@import './assets/css/index.css';`
60
+
61
+ ## 发布到 dev / uat / live 环境
24
62
 
25
63
  ```bash
26
- $ npm test
64
+ $ npm run pubilsh (dev|uat|live)
27
65
  ```
28
66
 
29
- Build library via `father`,
67
+ dev 环境打包后会在 tms-dist-dev uat 环境打包后会在 tms-dist-uat live 环境打包后会在 tms-dist
68
+
69
+ 项目在 package.json 中根据需求引入不同的环境变量,分别是:
30
70
 
31
- ```bash
32
- $ npm run build
71
+ ```
72
+ "tms-auth": "git+https://bitbucket.org/chatly-biz-tool/tms-auth.git#tms-dist-dev"
33
73
  ```
34
74
 
35
- ```bash
36
- $ npm run pubilsh (dev|uat|live)
37
75
  ```
76
+ "tms-auth": "git+https://bitbucket.org/chatly-biz-tool/tms-auth.git#tms-dist-uat"
77
+ ```
78
+
79
+ ```
80
+ "tms-auth": "git+https://bitbucket.org/chatly-biz-tool/tms-auth.git#tms-dist"
81
+ ```
82
+
83
+ #### 发布失败的原因
84
+
85
+ 1.网络原因:重新发布 2.其他原因:删除 nodemoudles 下的.cache 文件(一般是发布过其他环境后容易出现这个问题)
38
86
 
39
- ## 踩过的坑
87
+ ### 发布到 npm 包
40
88
 
41
- 发布失败的原因: 1.网络原因:重新发布 2.其他原因:删除 nodemoudles 下的.cache 文件(一般是发布过其他环境后容易出现这个问题)
89
+ 1. 设置源 npm config set registry https://registry.npmjs.org/
90
+ 2. 登录 npm 账号:npm login
91
+ 3. 发布:npm publish