diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..86df7007918aee48b11cac9ef4e043c466fd2321 Binary files /dev/null and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index 3c3629e647f5ddf82548912e337bea9826b434af..2afc2e2a976c9d4c77c6c9073a466752b4bea440 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,53 @@ -node_modules +# See http://help.github.com/ignore-files/ for more about ignoring files. + +# compiled output +/dist +/tmp +/out-tsc +# Only exists if Bazel was run +/bazel-out + +# dependencies +/node_modules +**/node_modules + +# profiling files +chrome-profiler-events.json +speed-measure-plugin.json + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace +*.lock + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +.history/* + +# misc +/.sass-cache +/connect.lock +/coverage +/libpeerconnection.log +npm-debug.log +yarn-error.log +testem.log +package-lock.json +/typings + +# System Files +.DS_Store +Thumbs.db + +.prettierrc +package-lock.json +debug.log \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 773abb16694ef6d09eb48b8897500fef7b2fb919..33e9798a1c9e7b593c5bf91c7a3498f21f4f0666 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,2 +1,42 @@ # Farris UI Vue 贡献指南 +下面是参与贡献 Farris UI 的共享指南,请在反馈`issue`和`Pull Request`之前,花费几分钟阅读以下内容。 +你也可以根据自己的实践经验,自由的通过`Pull Reqeust`修改完善这个指南。 + +## 反馈Issue + +如有你认为自己新发现了一个bug,或者提出一个新特性,请先确定之前没有人提出或者修复过这个bug或者特性。你可以在Issues列表和PR列表中搜索是否有人已经提出了类似bug或者特性。 + +接下来你可以在Issue列表界面创建一个新的Issue,我们为你提供了Issue模板,请在Issue模板中标记是要反馈「bug」还是「新特性」,并提供必须的上下文说明,以便于开发者可以清晰的理解你的意图。 + +## 领取Issue + +如果你对修复某个bug,或者实现某个新特性敢兴趣,请在这个Issue下方通过评论告诉我们,我们可以进行充分沟通这个「bug」或者「新特性」的具体细节,然后会将Issue的负责人指定给你,将有你负责后续开发工作。 +请务必首先认领Issue然后在在开启你的贡献工作。 + +## 贡献代码 + +如果你成功领取了项目Issue,请通过Gitee推荐的「fork + pull request」的方式贡献代码。 +为了保证项目代码质量,我们指定了详细的编码风格指南。 +为了你的PR可以顺利通过代码审查,请在编码前认真阅读以下**编码指南**: + +- [Farris UI TypeScript 编码指南](./style-guide/typescript_style_guide.md) + +- [Farris UI Vue 组件编码指南](./style-guide/vue_component_style_guide.md) + +## 提交Pull Request + +我们欢迎你通过提交PR参与项目贡献,在你计划提交PR前,请先阅读以下注意事项: + +- 在你提交PR之前请确保已经开启了一个Issue并认领了它,我们只接收与认领Issue关联的PR。如果你打算实现一个比较大的特性,在开启新的Issue前最好先与项目管理者进行充分讨论。 + +- 在没有十足把握时,尽量提交小规格的PR。不要在一个PR中修复多于一个bug或实现多于一个新特性,以便于更容易被接受。提交两个小规模的PR,会比提交一个大规模修改的PR要好。 + +- 当你提交新特性,或者修改已有特性时,请包含相应的测试代码,以便于确认组件新的交互特性。 + +- 在提交PR前端请先执行Rebase以便于保持干净的历史提交记录。 + +- 我们提供了PR模板,请在提交PR时安装模板要求提供「修改的内容」、「管理的PR」、「测试用例」、「界面预览」等相关内容。 + + +Creative Commons License diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 0000000000000000000000000000000000000000..b2388de1e270117c8f16a612af65c4d09d8946d3 --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,110 @@ +const types = ['config', 'feature', 'fix', 'docs', 'style', 'refactor', 'performance', 'test', 'build', 'release', 'chore', 'revert']; + +module.exports = { + parserPreset: { parserOpts: { headerPattern: /^(\w*)(?:\((.*)\))?!?: (.*)$/ } }, + extends: ['@commitlint/config-conventional'], + rules: { + 'type-empty': [2, 'never'], + 'type-enum': [2, 'always', types], + 'scope-case': [0, 'always'], + 'subject-empty': [2, 'never'], + 'subject-case': [0, 'never'], + 'header-max-length': [2, 'always', 88], + }, + prompt: { + questions: { + type: { + description: "Select the type of change that you're committing", + enum: { + config: { + description: 'Changes that affect the tools, such as eslint, npm, vscode.', + title: 'Config', + emoji: '🛠', + }, + feature: { + description: 'A new feature', + title: 'Features', + emoji: '✨', + }, + fix: { + description: 'A bug fix', + title: 'Bug Fixes', + emoji: '🐛', + }, + docs: { + description: 'Documentation only changes', + title: 'Documentation', + emoji: '📚', + }, + style: { + description: 'Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)', + title: 'Styles', + emoji: '💎', + }, + refactor: { + description: 'A code change that neither fixes a bug nor adds a feature', + title: 'Code Refactoring', + emoji: '📦', + }, + performance: { + description: 'A code change that improves performance', + title: 'Performance Improvements', + emoji: '🚀', + }, + test: { + description: 'Adding missing tests or correcting existing tests', + title: 'Tests', + emoji: '🚨', + }, + build: { + description: 'Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)', + title: 'Builds', + emoji: '🛠', + }, + ci: { + description: 'Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)', + title: 'Continuous Integrations', + emoji: '⚙️', + }, + chore: { + description: "Other changes that don't modify src or test files", + title: 'Chores', + emoji: '♻️', + }, + revert: { + description: 'Reverts a previous commit', + title: 'Reverts', + emoji: '🗑', + }, + }, + }, + scope: { + description: 'What is the scope of this change (e.g. component or file name)', + }, + subject: { + description: 'Write a short, imperative tense description of the change', + }, + body: { + description: 'Provide a longer description of the change', + }, + isBreaking: { + description: 'Are there any breaking changes?', + }, + breakingBody: { + description: 'A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself', + }, + breaking: { + description: 'Describe the breaking changes', + }, + isIssueAffected: { + description: 'Does this change affect any open issues?', + }, + issuesBody: { + description: 'If issues are closed, the commit requires a body. Please enter a longer description of the commit itself', + }, + issues: { + description: 'Add issue references (e.g. "fix #123", "re #123".)', + }, + }, + } +}; diff --git a/lerna.json b/lerna.json index 3467e1849809940477ed454966b4c48f0f2f0897..566085002c6b8ea9de49c1602a8e57a452bc9568 100644 --- a/lerna.json +++ b/lerna.json @@ -4,5 +4,7 @@ ], "version": "0.0.0", "useWorkspaces": true, - "npmClient": "yarn" + "npmClient": "yarn", + "$schema": "node_modules/lerna/schemas/lerna-schema.json", + "useNx": false } \ No newline at end of file diff --git a/package.json b/package.json index 86de6d3c14a509d6eacf86b05d721d363bf23ee0..7909d6ae167e812bfa630abbf8e1b623dfd7036b 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,41 @@ { "name": "farris-vue", "private": true, + "scripts": { + "prepare": "husky install" + }, "devDependencies": { - "lerna": "^4.0.0" + "@commitlint/cli": "^17.1.0", + "@commitlint/config-conventional": "^17.1.0", + "@farris/eslint-config": "^1.0.0", + "@ls-lint/ls-lint": "^1.11.0", + "@types/jest": "^29.0.1", + "@types/lodash": "^4.14.182", + "@types/node": "^18.7.16", + "esbuild-register": "^3.3.0", + "eslint": "^8.23.1", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-vue": "^9.4.0", + "husky": "^8.0.0", + "intersection-observer": "^0.12.2", + "lerna": "^5.5.4", + "lint-staged": "^13.0.0", + "npm-run-all": "^4.1.5", + "stylelint": "^14.11.0", + "stylelint-config-recommended-scss": "^7.0.0", + "stylelint-config-standard": "^28.0.0", + "stylelint-scss": "^3.3.1" + }, + "lint-staged": { + "packages/docs-vue/{*.vue,*.js,*.ts,*.jsx,*.tsx}": "eslint --fix", + "packages/docs-vue/{*.scss,*.css}": "stylelint --fix", + "packages/ui-vue/{*.vue,*.js,*.ts,*.jsx,*.tsx}": "eslint --fix", + "packages/ui-vue/{*.scss,*.css}": "stylelint --fix" }, "workspaces": [ "packages/*" - ] + ], + "dependencies": { + "jest-environment-jsdom": "^29.0.3" + } } diff --git a/packages/.DS_Store b/packages/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..2587beebcfa28b73ef2ca18bb96a61f525255037 Binary files /dev/null and b/packages/.DS_Store differ diff --git a/packages/docs-vue/src/App.vue b/packages/docs-vue/src/App.vue index 76ebf08602f44896819c3b46c7834af5a9bd02ff..de11b55f0302931280ea8d749185fcaf852c35dd 100644 --- a/packages/docs-vue/src/App.vue +++ b/packages/docs-vue/src/App.vue @@ -1,7 +1,7 @@