Skip to content

Commit e8fdf49

Browse files
committed
refactor: using lib-boilerplate-ts
1 parent 6352536 commit e8fdf49

16 files changed

+531
-165
lines changed

.github/CONTRIBUTING.md

-10
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,3 @@ Here are some guidelines to make the process smoother:
1414
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
1515
- **Send coherent history** - Make sure your commits message means something
1616
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.
17-
18-
## Creating issues
19-
20-
### Bug reports
21-
22-
Always try to provide as much information as possible. If you are reporting a bug, try to provide a repro on jsfiddle.net (or anything else) or a stacktrace at the very least. This will help us check the problem quicker.
23-
24-
### Feature requests
25-
26-
Lay out the reasoning behind it and propose an API for it. Ideally, you should have a practical example to prove the utility of the feature you're requesting.

.github/ISSUE_TEMPLATE.md

-8
This file was deleted.

.github/ISSUE_TEMPLATE/bug_report.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
---
8+
9+
### Reproduction
10+
11+
If possible, provide a boiled down editable reproduction using a service like JSFiddle, Codepen or CodeSandbox. A failing unit test is even better! Otherwise provide as much information as possible to reproduce the problem.
12+
If no reproduction is provided and the information is not enough to reproduce the problem, we won't be able to give it a look
13+
14+
### Steps to reproduce the behavior
15+
16+
1. Go to '...'
17+
2. Click on '....'
18+
3. Scroll down to '....'
19+
4. See error
20+
21+
### Expected behavior
22+
23+
A clear and concise description of what you expected to happen.
24+
25+
### Actual behavior
26+
27+
A clear and concise description of what actually happens.
28+
29+
### Additional information
30+
31+
Add any other context about the problem here.
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: feature request
6+
assignees: ''
7+
8+
---
9+
10+
### What problem is this solving
11+
12+
A clear and concise description of what the problem is. Ex. when using the function X we cannot do Y.
13+
14+
### Proposed solution
15+
16+
A clear and concise description of what you want to happen with an API proposal when applicable
17+
18+
### Describe alternatives you've considered
19+
20+
A clear and concise description of any alternative solutions or features you've considered.

.github/PULL_REQUEST_TEMPLATE.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#Pull-Request
55

66
<!-- PULL REQUEST TEMPLATE -->
77
<!-- (Update "[ ]" to "[x]" to check a box) -->
8+
<!-- Tip: publish the PR and check the checkboxes by simply clicking on them -->
89

910
**What kind of change does this PR introduce?** (check at least one)
1011

.github/commit-convention.md

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
## Git Commit Message Convention
2+
3+
> This is adapted from [Angular's commit convention](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular).
4+
5+
#### TL;DR:
6+
7+
Messages must be matched by the following regex:
8+
9+
```text
10+
/^(revert: )?(feat|fix|docs|dx|style|refactor|perf|test|workflow|build|ci|chore|types|wip)(\(.+\))?: .{1,50}/
11+
```
12+
13+
#### Examples
14+
15+
Appears under "Features" header, `link` subheader:
16+
17+
```
18+
feat(link): add `force` option
19+
```
20+
21+
Appears under "Bug Fixes" header, `view` subheader, with a link to issue #28:
22+
23+
```
24+
fix(view): handle keep-alive with aborted navigations
25+
26+
close #28
27+
```
28+
29+
Appears under "Performance Improvements" header, and under "Breaking Changes" with the breaking change explanation:
30+
31+
```
32+
perf: improve guard extraction
33+
34+
BREAKING CHANGE: The 'beforeRouteEnter' option has been removed.
35+
```
36+
37+
The following commit and commit `667ecc1` do not appear in the changelog if they are under the same release. If not, the revert commit appears under the "Reverts" header.
38+
39+
```
40+
revert: feat(compiler): add 'comments' option
41+
42+
This reverts commit 667ecc1654a317a13331b17617d973392f415f02.
43+
```
44+
45+
### Full Message Format
46+
47+
A commit message consists of a **header**, **body** and **footer**. The header has a **type**, **scope** and **subject**:
48+
49+
```
50+
<type>(<scope>): <subject>
51+
<BLANK LINE>
52+
<body>
53+
<BLANK LINE>
54+
<footer>
55+
```
56+
57+
The **header** is mandatory and the **scope** of the header is optional.
58+
59+
### Revert
60+
61+
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body, it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
62+
63+
### Type
64+
65+
If the prefix is `feat`, `fix` or `perf`, it will appear in the changelog. However, if there is any [BREAKING CHANGE](#footer), the commit will always appear in the changelog.
66+
67+
Other prefixes are up to your discretion. Suggested prefixes are `docs`, `chore`, `style`, `refactor`, and `test` for non-changelog related tasks.
68+
69+
### Scope
70+
71+
The scope could be anything specifying the place of the commit change. For example `core`, `compiler`, `ssr`, `v-model`, `transition` etc...
72+
73+
### Subject
74+
75+
The subject contains a succinct description of the change:
76+
77+
- use the imperative, present tense: "change" not "changed" nor "changes"
78+
- don't capitalize the first letter
79+
- no dot (.) at the end
80+
81+
### Body
82+
83+
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
84+
The body should include the motivation for the change and contrast this with previous behavior.
85+
86+
### Footer
87+
88+
The footer should contain any information about **Breaking Changes** and is also the place to
89+
reference GitHub issues that this commit **Closes**.
90+
91+
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.

.github/funding.yml

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
github: posva
2-
patreon: posva
32
custom: https://www.paypal.me/posva

.release-it.json

-15
This file was deleted.

.vscode/settings.json

+4-5
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
"[typescript]": {
66
"editor.formatOnSave": false
77
},
8-
"eslint.autoFixOnSave": true,
9-
"eslint.validate": [
10-
"javascript",
11-
{ "language": "typescript", "autoFix": true }
12-
]
8+
"eslint.validate": ["javascript", "typescript"],
9+
"editor.codeActionsOnSave": {
10+
"source.fixAll.eslint": true
11+
}
1312
}

README.md

+16
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44
55
Demo (TODO link)
66

7+
## Copying this project
8+
9+
Using [degit](https://github.com/Rich-Harris/degit):
10+
11+
```sh
12+
degit posva/vue-lib-boilerplate
13+
```
14+
15+
(Remove this section after creating your own lib)
16+
717
## Installation
818

919
```sh
@@ -19,3 +29,9 @@ npm install lib-boilerplate
1929
## License
2030

2131
[MIT](http://opensource.org/licenses/MIT)
32+
33+
<div align="right">
34+
<sub><em>
35+
This project was created using the <a href="https://github.com/posva/vue-lib-boilerplate" rel="nofollow">Vue Library boilerplate</a> by (<a href="https://github.com/posva" rel="nofollow">posva</a>)
36+
</em></sub>
37+
</div>

api-extractor.json

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// this the shared base config for all packages.
2+
{
3+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
4+
5+
"mainEntryPointFilePath": "./dist/src/index.d.ts",
6+
7+
"apiReport": {
8+
"enabled": true,
9+
"reportFolder": "<projectFolder>/temp/"
10+
},
11+
12+
"docModel": {
13+
"enabled": true
14+
},
15+
16+
"dtsRollup": {
17+
"enabled": true,
18+
"untrimmedFilePath": "./dist/<unscopedPackageName>.d.ts"
19+
},
20+
21+
"tsdocMetadata": {
22+
"enabled": false
23+
},
24+
25+
"messages": {
26+
"compilerMessageReporting": {
27+
"default": {
28+
"logLevel": "warning"
29+
}
30+
},
31+
32+
"extractorMessageReporting": {
33+
"default": {
34+
"logLevel": "warning",
35+
"addToApiReportFile": true
36+
},
37+
38+
"ae-missing-release-tag": {
39+
"logLevel": "none"
40+
}
41+
},
42+
43+
"tsdocMessageReporting": {
44+
"default": {
45+
"logLevel": "warning"
46+
}
47+
}
48+
}
49+
}

package.json

+53-22
Original file line numberDiff line numberDiff line change
@@ -2,54 +2,85 @@
22
"name": "lib-boilerplate-ts",
33
"version": "0.0.0",
44
"description": "Some awesome description",
5-
"main": "dist/lib-boilerplate-ts.common.js",
6-
"module": "dist/lib-boilerplate-ts.esm.js",
7-
"unpkg": "dist/lib-boilerplate-ts.js",
8-
"browser": "dist/lib-boilerplate-ts.esm.js",
9-
"types": "dist/lib-boilerplate-ts/src",
5+
"main": "dist/vue-lib-boilerplate.cjs.js",
6+
"browser": "dist/vue-lib-boilerplate.esm.js",
7+
"unpkg": "dist/vue-lib-boilerplate.global.js",
8+
"jsdelivr": "dist/vue-lib-boilerplate.global.js",
9+
"module": "dist/vue-lib-boilerplate.esm-bundler.js",
10+
"types": "dist/vue-lib-boilerplate.d.ts",
1011
"sideEffects": false,
1112
"author": {
1213
"name": "Eduardo San Martin Morote",
1314
"email": "[email protected]"
1415
},
1516
"scripts": {
16-
"lint": "eslint --color --ext=js,html,vue,ts src __tests__ *.js",
17-
"lint:fix": "yarn run lint --fix",
18-
"unit": "jest",
19-
"dev": "yarn run unit --watchAll",
20-
"pretest": "yarn run lint",
21-
"test": "yarn run unit && yarn run build",
2217
"build": "rollup -c rollup.config.js",
23-
"prepublishOnly": "yarn run build"
18+
"build:dts": "api-extractor run --local --verbose",
19+
"release": "bash scripts/release.sh",
20+
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1",
21+
"size": "size-limit",
22+
"lint": "prettier -c --parser typescript \"{src,__tests__,e2e}/**/*.[jt]s?(x)\"",
23+
"lint:fix": "yarn run lint --write",
24+
"test:types": "tsc --build tsconfig.json",
25+
"test:unit": "jest --coverage",
26+
"test": "yarn run test:types && yarn run test:unit && yarn run build && yarn run build:dts"
2427
},
2528
"files": [
26-
"dist",
29+
"dist/*.js",
30+
"dist/vue-lib-boilerplate.d.ts",
2731
"LICENSE",
2832
"README.md"
2933
],
3034
"keywords": [],
3135
"license": "MIT",
3236
"devDependencies": {
33-
"@rollup/plugin-alias": "^3.0.0",
34-
"@rollup/plugin-replace": "^2.2.1",
37+
"@microsoft/api-extractor": "^7.8.1",
38+
"@rollup/plugin-alias": "^3.1.1",
39+
"@rollup/plugin-commonjs": "^14.0.0",
40+
"@rollup/plugin-node-resolve": "^8.4.0",
41+
"@rollup/plugin-replace": "^2.3.3",
42+
"@size-limit/preset-small-lib": "^4.5.5",
3543
"@types/jest": "^26.0.8",
36-
"@typescript-eslint/eslint-plugin": "^3.7.1",
37-
"@typescript-eslint/parser": "^3.7.1",
44+
"@types/jsdom": "^16.2.3",
3845
"codecov": "^3.7.2",
39-
"eslint": "^7.6.0",
40-
"eslint-config-prettier": "^6.11.0",
41-
"eslint-plugin-prettier": "^3.1.4",
46+
"conventional-changelog-cli": "^2.0.34",
4247
"jest": "^26.2.2",
48+
"lint-staged": "^10.2.11",
4349
"pascalcase": "^1.0.0",
4450
"prettier": "^2.0.5",
45-
"rimraf": "^3.0.2",
4651
"rollup": "^2.23.0",
4752
"rollup-plugin-commonjs": "^10.1.0",
4853
"rollup-plugin-node-resolve": "^5.2.0",
4954
"rollup-plugin-terser": "^6.1.0",
5055
"rollup-plugin-typescript2": "^0.27.1",
56+
"size-limit": "^4.5.5",
5157
"ts-jest": "^26.1.4",
52-
"typescript": "^3.9.7"
58+
"typescript": "^3.9.7",
59+
"vue": "^3.0.0-rc.5",
60+
"yorkie": "^2.0.0"
61+
},
62+
"gitHooks": {
63+
"pre-commit": "lint-staged",
64+
"commit-msg": "node scripts/verifyCommit.js"
65+
},
66+
"lint-staged": {
67+
"*.js": [
68+
"prettier --write"
69+
],
70+
"*.ts?(x)": [
71+
"prettier --parser=typescript --write"
72+
]
73+
},
74+
"size-limit": [
75+
{
76+
"path": "size-checks/webRouter.js"
77+
},
78+
{
79+
"path": "size-checks/webRouterAndVue.js"
80+
}
81+
],
82+
"peerDependencies": {
83+
"vue": "^3.0.0-beta.20"
5384
},
5485
"repository": {
5586
"type": "git",

0 commit comments

Comments
 (0)