Skip to content

Commit

Permalink
publish v0.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
youniaogu committed Nov 27, 2020
1 parent fb2ef4a commit 621d13e
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 93 deletions.
12 changes: 9 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# Change Log

## [0.0.1]-2020/11/26
## [0.0.3]-2020/11/27

- more rule
- change readme
- add placeholder on input and picker

## [0.0.2]-2020/11/26

- change package.json
- change readme.md
- change changelog.md
- change readme
- change changelog

## [0.0.1]-2020/11/26

Expand Down
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ a vscode extensions for fast write snippet to clipboard

replace snippet keyword by rule and copy to clipboard

rule:
ruleList:

| e.g name | loadUserInfo |
| --------------------- | ---------------- |
| `#NAME#` | `loadUserInfo` |
| `#FIRSET_UPPER_NAME#` | `LoadUserInfo` |
| `#UPPER_NAME#` | `LOAD_USER_INFO` |
e.g name: loadUserInfo

| keyword | result |
| ------------------------ | ---------------- |
| `#NAME#` | `loadUserInfo` |
| `#UPPER_NAME#` | `LOADUSERINFO` |
| `#FIRSET_UPPER_NAME#` | `LoadUserInfo` |
| `#UPPER_UNDERLINE_NAME#` | `LOAD_USER_INFO` |
| `#LOWER_NAME#` | `loaduserinfo` |

E.g:

Expand Down
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@
"compile": "webpack --devtool nosources-source-map --config ./build/node-extension.webpack.config.js",
"watch": "webpack --watch --devtool nosources-source-map --info-verbosity verbose --config ./build/node-extension.webpack.config.js",
"package": "webpack --mode production --config ./build/node-extension.webpack.config.js",
"test-compile": "tsc -p ./",
"test-watch": "tsc -watch -p ./",
"pretest": "yarn run test-compile && yarn run lint",
"lint": "eslint src --ext ts",
"test": "node ./out/test/runTest.js"
"lint": "eslint src --ext ts"
},
"devDependencies": {
"@types/vscode": "^1.51.0",
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Main {
showInput() {
return window.showInputBox({ placeHolder: 'please enter a name' }).then((data) => {
if (!data) {
return Promise.reject(new Error('关键字为空'));
return Promise.reject(new Error('name is empty'));
}

this.name = data;
Expand Down
23 changes: 0 additions & 23 deletions src/test/runTest.ts

This file was deleted.

15 changes: 0 additions & 15 deletions src/test/suite/extension.test.ts

This file was deleted.

38 changes: 0 additions & 38 deletions src/test/suite/index.ts

This file was deleted.

8 changes: 6 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
export function replaceName(template: string, name: string): string {
const upperName = name.toUpperCase();
const firstUpperName = name.replace(/[a-z]/, function (s) {
return s.toUpperCase();
});
const upperName = name.replace(/\B([A-Z])/g, '_$1').toUpperCase();
const upperUnderlineName = name.replace(/\B([A-Z])/g, '_$1').toUpperCase();
const lowerName = name.toLowerCase();

template = template.replace(/\#NAME\#/g, name);
template = template.replace(/\#FIRSET_UPPER_NAME\#/g, firstUpperName);
template = template.replace(/\#UPPER_NAME\#/g, upperName);
template = template.replace(/\#FIRSET_UPPER_NAME\#/g, firstUpperName);
template = template.replace(/\#UPPER_UNDERLINE_NAME\#/g, upperUnderlineName);
template = template.replace(/\#LOWER_NAME\#/g, lowerName);

return template;
}
Binary file modified static/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 621d13e

Please sign in to comment.