Skip to content

Commit

Permalink
feat: 完成工具设计
Browse files Browse the repository at this point in the history
  • Loading branch information
CaoMeiYouRen committed Dec 6, 2020
0 parents commit 82436b4
Show file tree
Hide file tree
Showing 19 changed files with 725 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# http://editorconfig.org
#启用编辑器配置
root = true
# 对所有文件生效
[*]
#编码方式
charset = utf-8
#缩进格式
indent_style = space
indent_size = 4
#换行符
end_of_line = lf
#插入最终换行符
insert_final_newline = false
#修剪尾随空格
trim_trailing_whitespace = true
# 对后缀名为 md 的文件生效
[*.md]
trim_trailing_whitespace = false
[*.sh]
#换行符
end_of_line = lf
[package.json]
indent_size = 2
10 changes: 10 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/dist/
#/*.js
/test/unit/coverage/
/test/unit/specs/
/build/
# /test/
/node_modules/
*.min.*
src/public/
/public/
31 changes: 31 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const IS_PROD = process.env.NODE_ENV === 'production'
module.exports = {
root: true,
globals: {
},
env: {
browser: true,
es6: true,
commonjs: true,
node: true,
mocha: true,
jest: true,
},
extends: [
'cmyr',
],
plugins: [
],
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: new Date().getFullYear(),
sourceType: 'module',
ecmaFeatures: {
modules: true,
},
},
parser: '@typescript-eslint/parser',
rules: {
'no-console': 0,
},
}
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
open-pull-requests-limit: 20
schedule:
interval: "daily"
time: "20:00"
timezone: "Asia/Shanghai"
38 changes: 38 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.DS_Store
node_modules

# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
*.log

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw*

# 忽略图片
*.jpg
*.png
*.rar

.git
# ssl
# *.crt
# *.key
# *.pem
sessions
/test
*.assets
#public
dist
temp
3 changes: 3 additions & 0 deletions .node-dev.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"notify": false
}
34 changes: 34 additions & 0 deletions .releaserc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const { name } = require('./package.json')
module.exports = {
plugins: [
[
"@semantic-release/commit-analyzer",
{
"config": "conventional-changelog-cmyr-config"
}
],
["@semantic-release/release-notes-generator",
{
"config": "conventional-changelog-cmyr-config"
}],
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md",
"changelogTitle": "# " + name
}
],
'@semantic-release/npm',
'@semantic-release/github',
[
"@semantic-release/git",
{
"assets": [
"src",
"CHANGELOG.md",
"package.json"
]
}
]
]
}
19 changes: 19 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
os: linux
language: node_js
node_js:
- 14
install:
- yarn
script:
- npm run lint
- npm run build
# deploy:
# provider: script
# skip_cleanup: true
# on:
# branch: master
# script:
# - npm run release
cache:
directories:
- node_modules
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 CaoMeiYouRen(草梅友仁)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# cmyr-template-cli

草梅友仁自制的项目模板创建器

ct create
11 changes: 11 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [2, 'always', [
'feat', 'fix', 'docs', 'style', 'refactor', 'test',
'chore', 'revert', 'upgrade', 'build', 'perf'
]],
'subject-full-stop': [0, 'never'],
'subject-case': [0, 'never']
}
}
92 changes: 92 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"name": "cmyr-template-cli",
"version": "0.1.0",
"description": "",
"author": "CaoMeiYouRen",
"private": true,
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"engines": {
"node": ">=12"
},
"bin": {
"ct": "dist/index.js",
"cmyr-template": "dist/index.js"
},
"scripts": {
"lint": "cross-env NODE_ENV=production eslint src --fix --ext .ts,.js",
"prebuild": "rimraf dist",
"build": "rimraf dist && tsc",
"build2": "cross-env NODE_ENV=production rollup -c",
"dev": "cross-env NODE_ENV=development ts-node-dev src/index.ts",
"dev:rollup": "cross-env NODE_ENV=development rollup -c",
"rm": "rimraf node_modules",
"start": "node ./dist/index",
"release": "semantic-release",
"commit": "git add . && git cz",
"create": "ct create",
"build:dev": "npm run build && rimraf temp && cross-env NODE_ENV=development ct create"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^11.0.0",
"@rollup/plugin-typescript": "^8.0.0",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/git": "^9.0.0",
"@types/debug": "^4.1.5",
"@types/fs-extra": "^9.0.4",
"@types/lodash": "^4.14.165",
"@types/node": "^14.14.10",
"@typescript-eslint/eslint-plugin": "^4.9.0",
"@typescript-eslint/parser": "^4.9.0",
"commitizen": "^4.2.2",
"conventional-changelog-cli": "^2.1.1",
"conventional-changelog-cmyr-config": "^1.2.3",
"cross-env": "^7.0.2",
"cz-conventional-changelog": "^3.3.0",
"debug": "^4.3.1",
"eslint": "^7.14.0",
"eslint-config-cmyr": "^1.0.2",
"husky": "^4.3.4",
"lint-staged": "^10.5.2",
"lodash": "^4.17.20",
"rimraf": "^3.0.2",
"rollup": "^2.33.3",
"rollup-plugin-terser": "^7.0.2",
"semantic-release": "^17.3.0",
"ts-node": "^9.0.0",
"ts-node-dev": "^1.0.0",
"typescript": "^4.1.2",
"validate-commit-msg": "^2.14.0"
},
"dependencies": {
"colors": "^1.4.0",
"commander": "^6.2.0",
"dayjs": "^1.9.6",
"download-git-repo": "^3.0.2",
"fs-extra": "^9.0.1",
"minimist": "^1.2.5",
"ora": "^5.1.0",
"plop": "^2.7.4"
},
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"changelog": {
"language": "zh"
},
"husky": {
"hooks": {
"pre-commit": "npm run lint && git add .",
"commit-msg": "validate-commit-msg"
}
}
}
Loading

0 comments on commit 82436b4

Please sign in to comment.