@guojinpeng/dsh-cost-meter 0.1.2 → 0.1.4
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 +21 -16
- package/README.zh-CN.md +20 -16
- package/dist/client.js +748 -722
- package/dist/index.js +129 -111
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -21,16 +21,8 @@ dsh plugin --profile web add -w @guojinpeng/dsh-cost-meter
|
|
|
21
21
|
Replace `web` with your profile name.
|
|
22
22
|
If you used the old unscoped package, disable it before you install this package.
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
Run this command in the download directory:
|
|
27
|
-
|
|
28
|
-
```powershell
|
|
29
|
-
dsh plugin --profile web add -w ./guojinpeng-dsh-cost-meter-0.1.2.tgz
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
Restart DSH.
|
|
33
|
-
Keep the downloaded file at the installation path.
|
|
24
|
+
Install published versions from npm. npm provides the built package.
|
|
25
|
+
GitHub contains the source code and release notes.
|
|
34
26
|
|
|
35
27
|
## Features
|
|
36
28
|
|
|
@@ -84,15 +76,16 @@ npm pack
|
|
|
84
76
|
```
|
|
85
77
|
|
|
86
78
|
`npm pack` also runs the build. It creates `guojinpeng-dsh-cost-meter-<version>.tgz`.
|
|
87
|
-
Install the generated file in your DSH profile. For version 0.1.
|
|
79
|
+
Install the generated file in your DSH profile. For version 0.1.4:
|
|
88
80
|
|
|
89
81
|
```powershell
|
|
90
|
-
dsh plugin --profile web add -w ./guojinpeng-dsh-cost-meter-0.1.
|
|
82
|
+
dsh plugin --profile web add -w ./guojinpeng-dsh-cost-meter-0.1.4.tgz
|
|
91
83
|
```
|
|
92
84
|
|
|
93
85
|
Restart DSH and check the plugin. Repeat the build, package and install steps after changes.
|
|
94
86
|
Tests use the global DSH installation. Set `DSH_RUNTIME_ROOT` to the DSH package directory if its location is different.
|
|
95
87
|
Commit source files and `pnpm-lock.yaml`. Do not commit generated files or local configuration.
|
|
88
|
+
See [the module guide](docs/architecture.md) for source boundaries and verification commands.
|
|
96
89
|
|
|
97
90
|
## Publish To npm
|
|
98
91
|
|
|
@@ -113,19 +106,31 @@ Update `package.json`. You can use this command to increase the patch version wi
|
|
|
113
106
|
npm version patch --no-git-tag-version
|
|
114
107
|
pnpm install --lockfile-only
|
|
115
108
|
npm test
|
|
116
|
-
npm pack
|
|
109
|
+
npm run pack:release
|
|
117
110
|
```
|
|
118
111
|
|
|
119
|
-
Check the file list
|
|
112
|
+
Check the package file list. `pack:release` runs `npm pack` and creates the versioned
|
|
113
|
+
npm tarball. Commit and push the version change. Then publish that tarball.
|
|
114
|
+
For example, replace `<version>` with the new version number:
|
|
120
115
|
|
|
121
116
|
```powershell
|
|
122
|
-
npm publish --access public --registry=https://registry.npmjs.org/
|
|
117
|
+
npm publish ./guojinpeng-dsh-cost-meter-<version>.tgz --access public --registry=https://registry.npmjs.org/
|
|
123
118
|
npm view @guojinpeng/dsh-cost-meter version --registry=https://registry.npmjs.org/
|
|
124
119
|
```
|
|
125
120
|
|
|
126
121
|
Complete npm's authentication steps when prompted.
|
|
127
122
|
Each package version can be published only once.
|
|
128
|
-
|
|
123
|
+
After npm publication succeeds, create the matching Git tag and GitHub Release:
|
|
124
|
+
|
|
125
|
+
```powershell
|
|
126
|
+
git tag v<version>
|
|
127
|
+
git push origin v<version>
|
|
128
|
+
gh release create v<version> --verify-tag --title "v<version>" --generate-notes --latest
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Replace `<version>` before you run these commands. GitHub Releases contain release
|
|
132
|
+
notes; uploading a tarball is optional. npm hosts the installation package.
|
|
133
|
+
The plugin catalog links the npm package through its `repository` field.
|
|
129
134
|
|
|
130
135
|
Users can then install the package:
|
|
131
136
|
|
package/README.zh-CN.md
CHANGED
|
@@ -21,16 +21,8 @@ dsh plugin --profile web add -w @guojinpeng/dsh-cost-meter
|
|
|
21
21
|
将 `web` 替换为你使用的 profile 名称。
|
|
22
22
|
如果已安装旧版无 scope 的插件,请先禁用旧版,再安装此插件。
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
下载 scoped 安装包。在下载目录执行:
|
|
27
|
-
|
|
28
|
-
```powershell
|
|
29
|
-
dsh plugin --profile web add -w ./guojinpeng-dsh-cost-meter-0.1.2.tgz
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
安装后重启 DSH。
|
|
33
|
-
请保留下载的安装包,不要改变其安装路径。
|
|
24
|
+
通过 npm 安装已发布版本,npm 提供构建后的安装包。
|
|
25
|
+
GitHub 用于保存源码和发布说明。
|
|
34
26
|
|
|
35
27
|
## 功能
|
|
36
28
|
|
|
@@ -84,15 +76,16 @@ npm pack
|
|
|
84
76
|
```
|
|
85
77
|
|
|
86
78
|
`npm pack` 也会执行构建,生成 `guojinpeng-dsh-cost-meter-<版本号>.tgz`。
|
|
87
|
-
将生成的文件安装到你的 DSH profile。以 0.1.
|
|
79
|
+
将生成的文件安装到你的 DSH profile。以 0.1.4 为例:
|
|
88
80
|
|
|
89
81
|
```powershell
|
|
90
|
-
dsh plugin --profile web add -w ./guojinpeng-dsh-cost-meter-0.1.
|
|
82
|
+
dsh plugin --profile web add -w ./guojinpeng-dsh-cost-meter-0.1.4.tgz
|
|
91
83
|
```
|
|
92
84
|
|
|
93
85
|
重启 DSH,检查插件。每次修改后,重新构建、打包并安装。
|
|
94
86
|
测试使用全局安装的 DSH。如果安装位置不同,将 `DSH_RUNTIME_ROOT` 设置为 DSH 包目录。
|
|
95
87
|
提交源码和 `pnpm-lock.yaml`。不要提交生成文件或本地配置。
|
|
88
|
+
模块职责、依赖边界和验证命令见[模块维护说明](docs/architecture.md)。
|
|
96
89
|
|
|
97
90
|
## 发布到 npm
|
|
98
91
|
|
|
@@ -113,19 +106,30 @@ npm view @guojinpeng/dsh-cost-meter version --registry=https://registry.npmjs.or
|
|
|
113
106
|
npm version patch --no-git-tag-version
|
|
114
107
|
pnpm install --lockfile-only
|
|
115
108
|
npm test
|
|
116
|
-
npm pack
|
|
109
|
+
npm run pack:release
|
|
117
110
|
```
|
|
118
111
|
|
|
119
|
-
|
|
112
|
+
检查安装包的文件列表。`pack:release` 执行 `npm pack`,生成带版本号的 npm 安装包。
|
|
113
|
+
提交并推送版本变更,然后发布该安装包。
|
|
114
|
+
执行前,将 `<version>` 替换为本次的新版本号:
|
|
120
115
|
|
|
121
116
|
```powershell
|
|
122
|
-
npm publish --access public --registry=https://registry.npmjs.org/
|
|
117
|
+
npm publish ./guojinpeng-dsh-cost-meter-<version>.tgz --access public --registry=https://registry.npmjs.org/
|
|
123
118
|
npm view @guojinpeng/dsh-cost-meter version --registry=https://registry.npmjs.org/
|
|
124
119
|
```
|
|
125
120
|
|
|
126
121
|
根据提示完成 npm 身份验证。
|
|
127
122
|
同一包版本只能发布一次。
|
|
128
|
-
|
|
123
|
+
npm 发布成功后,创建对应的 Git 标签和 GitHub Release:
|
|
124
|
+
|
|
125
|
+
```powershell
|
|
126
|
+
git tag v<version>
|
|
127
|
+
git push origin v<version>
|
|
128
|
+
gh release create v<version> --verify-tag --title "v<version>" --generate-notes --latest
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
执行前替换 `<version>`。GitHub Release 用于发布说明,无需上传安装包。
|
|
132
|
+
npm 托管安装包,插件市场通过 npm 包的 `repository` 字段关联仓库。
|
|
129
133
|
|
|
130
134
|
发布后,用户可执行以下命令安装:
|
|
131
135
|
|