Skip to content

Commit 53ac963

Browse files
author
levy
committed
Merge branch 'dev'
2 parents 95dbea6 + 15c209d commit 53ac963

File tree

8 files changed

+76
-7
lines changed

8 files changed

+76
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
.idea
44
.DS_Store
55
v-test
6+
package-lock.json

init.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ if (!isUpgrade()) {
7676
patterns: {
7777
gitignore: '.gitignore',
7878
'_package.json': 'package.json',
79-
'src/component.vue': `src/${componentName}.vue`
79+
'src/component.vue': `src/${componentName}.vue`,
80+
'src/component.d.ts': `src/${componentName}.d.ts`
8081
}
8182
})
8283

templates/.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
branches:
22
only:
3-
- master
3+
- main
44
language: node_js
55
node_js:
66
- lts/*
@@ -20,7 +20,11 @@ deploy:
2020
github-token: $GITHUB_TOKEN
2121
skip-cleanup: true
2222
keep-history: true
23+
on:
24+
branch: main
2325
- provider: npm
2426
email: [email protected] # use your own email
2527
api_key: $NPM_TOKEN
2628
skip-cleanup: true
29+
on:
30+
branch: main

templates/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# {{componentName}}
22

3-
[![Build Status](https://badgen.net/travis/{{ownerName}}/{{componentName}}/master)](https://travis-ci.com/{{ownerName}}/{{componentName}})
3+
[![Build Status](https://badgen.net/travis/{{ownerName}}/{{componentName}}/main)](https://travis-ci.com/{{ownerName}}/{{componentName}})
44
[![NPM Download](https://badgen.net/npm/dm/@{{ownerNameLowerCase}}/{{componentName}})](https://www.npmjs.com/package/@{{ownerNameLowerCase}}/{{componentName}})
55
[![NPM Version](https://badge.fury.io/js/%40{{ownerNameLowerCase}}%2F{{componentName}}.svg)](https://www.npmjs.com/package/@{{ownerNameLowerCase}}/{{componentName}})
6-
[![NPM License](https://badgen.net/npm/license/@{{ownerNameLowerCase}}/{{componentName}})](https://github.com/{{ownerName}}/{{componentName}}/blob/master/LICENSE)
6+
[![NPM License](https://badgen.net/npm/license/@{{ownerNameLowerCase}}/{{componentName}})](https://github.com/{{ownerName}}/{{componentName}}/blob/main/LICENSE)
77
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/{{ownerName}}/{{componentName}}/pulls)
88
[![Automated Release Notes by gren](https://img.shields.io/badge/%F0%9F%A4%96-release%20notes-00B2EE.svg)](https://github-tools.github.io/github-release-notes/)
99

@@ -53,7 +53,7 @@ For those who are interested in contributing to this project, such as:
5353
- fix a bug
5454
- implement a new feature
5555

56-
Please refer to our [contributing guide](https://github.com/FEMessage/.github/blob/master/CONTRIBUTING.md).
56+
Please refer to our [contributing guide](https://github.com/FEMessage/.github/blob/main/CONTRIBUTING.md).
5757

5858
[⬆ Back to Top](#table-of-contents)
5959

templates/_package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"browser": {
2424
"./sfc": "src/{{componentName}}.vue"
2525
},
26+
"types": "src/{{componentName}}.d.ts",
2627
"scripts": {
2728
"dev": "vue-styleguidist server",
2829
"test": "jest --verbose",

templates/gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ docs/*.ttf
1717
*.njsproj
1818
*.sln
1919
.env
20+
21+
package-lock.json

templates/notify.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ ORG_NAME=$(echo "$TRAVIS_REPO_SLUG" | cut -d '/' -f 1)
1111
REPO_NAME=$(echo "$TRAVIS_REPO_SLUG" | cut -d '/' -f 2)
1212

1313
echo "2/5: pushing commit and tag to github"
14-
# 该命令很可能报错,但不影响实际进行,因而不能简单地在脚本开头 set -e
14+
# 该命令很可能报错,但不影响实际进行,因而不能简单地在脚本开头 set -e
1515
git remote add github https://$GITHUB_TOKEN@github.com/$TRAVIS_REPO_SLUG.git > /dev/null 2>&1
16-
git push github HEAD:master --follow-tags
16+
git push github HEAD:main --follow-tags
1717

1818
echo "3/5: generating github release notes"
1919
GREN_GITHUB_TOKEN=$GITHUB_TOKEN yarn release

templates/src/component.d.ts

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import Vue, {VueConstructor} from 'vue'
2+
3+
/**
4+
* @FYI https://www.yuque.com/docs/share/a72a1b84-c0e4-4bd5-853f-6711cb08a507
5+
*/
6+
declare module '@{{ownerNameLowerCase}}/{{componentName}}' {
7+
class VueComponent extends Vue {
8+
static install(vue: typeof Vue): void
9+
}
10+
11+
type CombinedVueInstance<
12+
Instance extends Vue,
13+
Data,
14+
Methods,
15+
Computed,
16+
Props
17+
> = Data & Methods & Computed & Props & Instance
18+
19+
type ExtendedVue<
20+
Instance extends Vue,
21+
Data,
22+
Methods,
23+
Computed,
24+
Props
25+
> = VueConstructor<
26+
CombinedVueInstance<Instance, Data, Methods, Computed, Props> & Vue
27+
>
28+
29+
type Combined<Data, Methods, Computed, Props> = Data &
30+
Methods &
31+
Computed &
32+
Props
33+
34+
type {{componentNamePascal}}Data = {}
35+
36+
type {{componentNamePascal}}Methods = {}
37+
38+
type {{componentNamePascal}}Computed = {}
39+
40+
type {{componentNamePascal}}Props = {}
41+
42+
type {{componentNamePascal}} = Combined<
43+
{{componentNamePascal}}Data,
44+
{{componentNamePascal}}Methods,
45+
{{componentNamePascal}}Computed,
46+
{{componentNamePascal}}Props
47+
>
48+
49+
export interface {{componentNamePascal}}Type extends VueComponent, {{componentNamePascal}} {}
50+
51+
const {{componentNamePascal}}Construction: ExtendedVue<
52+
Vue,
53+
{{componentNamePascal}}Data,
54+
{{componentNamePascal}}Methods,
55+
{{componentNamePascal}}Computed,
56+
{{componentNamePascal}}Props
57+
>
58+
59+
export default {{componentNamePascal}}Construction
60+
}

0 commit comments

Comments
 (0)