Skip to content

Commit 2ecd521

Browse files
committed
fix: update vsce publish flow
1 parent fedbe0b commit 2ecd521

File tree

12 files changed

+98
-13
lines changed

12 files changed

+98
-13
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ node_modules
22
client/out
33
client/node_modules
44
server/out
5-
server/node_modules
5+
server/node_modules
6+
react-intl-linter-0.0.1.vsix

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div align="center">
22

3-
![](./icon.png)
3+
![](https://s3.bmp.ovh/imgs/2021/09/c9214e94371f0e22.png)
44
# react-intl-linter💡
55
自动替换中文字符串为 react-intl 代码的 VS Code 插件
66

client/README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<div align="center">
2+
3+
# react-intl-linter💡
4+
自动替换中文字符串为 react-intl 代码的 VS Code 插件
5+
6+
</div>
7+
8+
9+
## 功能
10+
11+
这个插件可以自动检测打开的文件中的包裹在单/双引号之间的**中文文本**,并提供用户一个提示,用户可以点击提示进行中文文本翻译并选择写入的 intl 内容,插件会自动更新配置文件
12+
- 中文字符串提示
13+
- 自动检测已有国际化配置是否已包含目标文本
14+
- 翻译目标文本至英文,用户可以选择或自定义 intl id 内容
15+
- 替换中文字符串为`intl.formatMessage({ id: ... })`
16+
17+
18+
## Structure
19+
20+
```
21+
.
22+
├── client // Language Client
23+
│ ├── src
24+
│ │ └── extension.ts // Language Client entry point
25+
├── package.json // The extension manifest.
26+
└── server // Language Server
27+
└── src
28+
└── server.ts // Language Server entry point
29+
```
30+
31+
## Debug
32+
33+
- Run `npm install` in this folder. This installs all necessary npm modules in both the client and server folder
34+
- Open VS Code on this folder.
35+
- Press Ctrl+Shift+B to compile the client and server.
36+
- Switch to the Debug viewlet.
37+
- Select `Launch Client` from the drop down.
38+
- Run the launch config.
39+
- If you want to debug the server as well use the launch configuration `Attach to Server`
40+
- In the [Extension Development Host] instance of VSCode, open a document in 'plain text' language mode.
41+
- Activate code action on the error on the first line.
42+
43+
## License
44+
Apache License 2.0

client/package-lock.json

Lines changed: 37 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export async function activate(context: ExtensionContext): Promise<void>
1414
{
1515
// 指明语言服务器路径
1616
// 因为我们只能将 client 目录下的文件作为 extension 发布,所以需要复制 server/out 下的文件至 client/out/server 下
17-
const serverModule = context.asAbsolutePath(path.join('client', 'out', 'server', 'server.js'));
17+
const serverModule = context.asAbsolutePath(path.join('server', 'out', 'server.js'));
1818

1919
// 国际化配置模版路径
2020
const intlConfigTemp = context.asAbsolutePath(path.join('client', 'src', 'lib', 'intl'))

client/src/lib/constant.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11

22
// 激活插件的语言文件,与根目录下的 package.json 中的 activationEvents 保持一致
33
export const ActivationLanguage = [
4-
"onLanguage:plaintext",
54
"onLanguage:typescript",
65
"onLanguage:typescriptreact",
76
"onLanguage:javascriptreact",

icon.png

-42.9 KB
Binary file not shown.

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
{
22
"name": "react-intl-linter",
3-
"publisher": "styx11<1654630248@qq.com>",
43
"version": "0.0.1",
4+
"publisher": "styx11",
55
"description": "vscode linter extension for react-intl",
66
"repository": "git@github.com:Styx11/react-intl-linter.git",
77
"author": "styx11 <1654630248@qq.com>",
88
"license": "Apache-2.0 License",
99
"private": true,
1010
"categories": [],
1111
"engines": {
12-
"vscode": "^1.43.0"
12+
"vscode": "^1.52.0"
1313
},
14-
"icon": "./icon.png",
14+
"icon": "react-intl-linter.icon.png",
1515
"activationEvents": [
16-
"onLanguage:plaintext",
1716
"onLanguage:typescript",
1817
"onLanguage:typescriptreact",
1918
"onLanguage:javascriptreact",
@@ -24,10 +23,10 @@
2423
"capabilities" : {
2524
"codeActionProvider" : true
2625
},
27-
"main": "./client/out/extension",
26+
"main": "client/out/extension",
2827
"scripts": {
2928
"vscode:prepublish": "yarn compile",
30-
"compile": "rimraf server/out && rimraf client/out && tsc -b && cp -r server/out client/out/server && cp -r server/node_modules client/out/server/node_modules",
29+
"compile": "rimraf server/out && rimraf client/out && tsc -b",
3130
"watch": "tsc -b -w",
3231
"lint": "npm run lint:client && npm run lint:server",
3332
"lint:client": "eslint --config ./client/.eslintrc.json ./client/src/*.ts",

react-intl-linter.icon.png

9.47 KB
Loading

server/package-lock.json

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)