Skip to content

Commit c5dcc15

Browse files
committed
Initial commit
0 parents  commit c5dcc15

12 files changed

+255
-0
lines changed

.commitlintrc.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
rules: {
3+
'type-enum': [
4+
2,
5+
'always',
6+
['build', 'chore', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'style', 'test', 'wip'],
7+
],
8+
},
9+
};

.github/FUNDING.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# These are supported funding model platforms
2+
3+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
custom: ['https://hust.cc', 'https://paypal.me/hustcc', 'https://atool.vip']

.github/workflows/build.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: build
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: macOS-latest
9+
10+
steps:
11+
- uses: actions/checkout@v1
12+
- name: Use Node.js 12
13+
uses: actions/setup-node@v1
14+
with:
15+
node-version: 12
16+
- name: ci
17+
run: |
18+
npm install
19+
npm run test
20+
npm run build
21+
- name: coverall
22+
if: success()
23+
uses: coverallsapp/github-action@master
24+
with:
25+
github-token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
9+
# Sys
10+
.DS_STORE
11+
.idea
12+
13+
# Node
14+
node_modules/
15+
16+
# Build
17+
dist
18+
lib
19+
esm
20+
21+
# Test
22+
coverage

.prettierrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"trailingComma": "all",
5+
"bracketSpacing": true,
6+
"printWidth": 120,
7+
"arrowParens": "always"
8+
}

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 Hust.cc
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Template
2+
3+
> Repository template for hustcc.
4+
5+
6+
[![Build Status](https://github.com/hustcc/template/workflows/build/badge.svg)](https://github.com/hustcc/template/actions)
7+
[![Coverage Status](https://coveralls.io/repos/github/hustcc/template/badge.svg?branch=master)](https://coveralls.io/github/hustcc/template?branch=master)
8+
[![npm Version](https://img.shields.io/npm/v/template.svg)](https://www.npmjs.com/package/template)
9+
[![npm Download](https://img.shields.io/npm/dm/template.svg)](https://www.npmjs.com/package/template)
10+
[![npm License](https://img.shields.io/npm/l/template.svg)](https://www.npmjs.com/package/template)
11+
12+
13+
14+
15+
## Usage
16+
17+
18+
19+
20+
## License
21+
22+
MIT@[hustcc](https://github.com/hustcc).

__tests__/index.spec.ts

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { Version } from '../src';
2+
3+
describe('template', () => {
4+
test('export', () => {
5+
expect(Version).toBe('0.1.0');
6+
});
7+
});

package.json

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
{
2+
"name": "template",
3+
"officialName": "template",
4+
"version": "1.0.0",
5+
"description": "template repo for hustcc",
6+
"license": "MIT",
7+
"main": "lib/index.js",
8+
"module": "esm/index.js",
9+
"browser": "dist/template.min.js",
10+
"types": "lib/index.d.ts",
11+
"files": [
12+
"src",
13+
"lib",
14+
"esm",
15+
"dist"
16+
],
17+
"scripts": {
18+
"clean": "rimraf -rf lib esm dist",
19+
"lint-staged": "lint-staged",
20+
"size": "limit-size",
21+
"test": "jest",
22+
"build:umd": "rimraf ./dist && rollup -c && npm run size",
23+
"build:cjs": "rimraf ./lib && tsc --module commonjs --outDir lib",
24+
"build:esm": "rimraf ./esm && tsc --module ESNext --outDir esm",
25+
"build": "npm run build:cjs && npm run build:esm && npm run build:umd",
26+
"prepublishOnly": "npm run build"
27+
},
28+
"keywords": [
29+
"template"
30+
],
31+
"devDependencies": {
32+
"@commitlint/cli": "^11.0.0",
33+
"@types/jest": "^26.0.20",
34+
"husky": "^5.0.9",
35+
"jest": "^26.6.3",
36+
"limit-size": "^0.1.4",
37+
"lint-staged": "^10.5.4",
38+
"prettier": "^2.2.1",
39+
"rimraf": "^3.0.2",
40+
"rollup": "^2.39.0",
41+
"rollup-plugin-node-resolve": "^5.2.0",
42+
"rollup-plugin-typescript": "^1.0.1",
43+
"rollup-plugin-uglify": "^6.0.4",
44+
"ts-jest": "^26.5.1",
45+
"typescript": "^4.1.5"
46+
},
47+
"jest": {
48+
"preset": "ts-jest",
49+
"collectCoverage": true,
50+
"testRegex": "(/__tests__/.*\\.(test|spec))\\.ts$",
51+
"collectCoverageFrom": [
52+
"src/**/*.ts"
53+
]
54+
},
55+
"lint-staged": {
56+
"*.{ts,tsx}": [
57+
"prettier --write",
58+
"git add"
59+
]
60+
},
61+
"limit-size": [
62+
{
63+
"path": "dist/template.min.js",
64+
"limit": "500b",
65+
"gzip": true
66+
},
67+
{
68+
"path": "dist/template.min.js",
69+
"limit": "1 Kb"
70+
}
71+
],
72+
"husky": {
73+
"hooks": {
74+
"pre-commit": "npm run lint-staged",
75+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
76+
}
77+
},
78+
"author": {
79+
"name": "hustcc",
80+
"url": "https://atool.vip/"
81+
},
82+
"repository": {
83+
"type": "git",
84+
"url": "https://github.com/hustcc/template"
85+
},
86+
"bugs": {
87+
"url": "https://github.com/hustcc/template/issues"
88+
}
89+
}

rollup.config.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { uglify } from 'rollup-plugin-uglify';
2+
import resolve from 'rollup-plugin-node-resolve';
3+
import typescript from 'rollup-plugin-typescript';
4+
5+
module.exports = [{
6+
input: 'src/index.ts',
7+
output: {
8+
file: 'dist/template.min.js',
9+
name: 'tplv',
10+
format: 'umd',
11+
sourcemap: false,
12+
},
13+
plugins: [
14+
resolve(),
15+
typescript(),
16+
uglify(),
17+
],
18+
}];

src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const v = '0.1.0';

tsconfig.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"compilerOptions": {
3+
"outDir": "lib",
4+
"module": "commonjs",
5+
"target": "es5",
6+
"jsx": "preserve",
7+
"moduleResolution": "node",
8+
"experimentalDecorators": true,
9+
"declaration": true,
10+
"sourceMap": true,
11+
"allowSyntheticDefaultImports": true,
12+
"esModuleInterop": true,
13+
"pretty": true,
14+
"lib": ["dom", "esnext"],
15+
"skipLibCheck": true,
16+
"sourceRoot": "src",
17+
"baseUrl": "src"
18+
},
19+
"include": ["src/**/*"],
20+
"exclude": ["node_modules"]
21+
}

0 commit comments

Comments
 (0)