From f96afb0d4a2ecad4b2f4f975eca8854f1fe844dc Mon Sep 17 00:00:00 2001 From: "shunquan.wang" Date: Thu, 22 Aug 2024 10:24:40 +0800 Subject: [PATCH] feat: update --- .gitignore | 4 ++ CONTRIBUTING.md | 103 ++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 71 ++++++++++++++++++++++++++++++--- 3 files changed, 173 insertions(+), 5 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/.gitignore b/.gitignore index e804e52..97bd335 100644 --- a/.gitignore +++ b/.gitignore @@ -122,6 +122,10 @@ dist # Stores VSCode versions used for testing VSCode extensions .vscode-test +# Misc +.DS_Store +*.pem + # yarn v2 .yarn/cache .yarn/unplugged diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..69a76ca --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,103 @@ +# Contribution Guidelines + +Hi! Thank you for taking the time to contribute to Hyperse! + +In order to make the best use of both your time and that of the Hyperse maintainers, please follow the guidelines in this document. + +## Branches + +There are 3 important branches to know about: + +- `master` - the default branch +- `minor` - a branch for commits which introduce new features which would go in the next [SemVer minor](https://semver.org/) release. +- `major` - a branch for commits which introduce breaking changes which would go in the next [SemVer major](https://semver.org/) release. + +Bug fixes should go direct in the `master` branch, from which new patch releases will be made regularly. Periodically the master branch will be merged into the `minor` and `major` branches. + +## Bug fixes + +If you would like to contribute a bugfix, please first create an issue detailing the bug, and indicate that you intend to fix it. When creating commits, please follow the commit message format below. + +## New features + +Again, please create a feature request detailing the functionality you intend to add, and state that you would like to implement it. When creating commits, please follow the commit message format below. New feature pull requests should be made against the `minor` branch. + +When adding new public APIs to support your new feature, add a `@since 1.2.0` tag (where "1.2.0" corresponds to what will be the next minor version) to the doc block. This will let readers of the documentation know the version in which the API was introduced. See the [docs readme](./README.md) for more details on the valid docs tags. + +```TypeScript +/** + * @description + * Sets the value of the new API thing. + * + * @since 1.2.0 + */ +myNewApi: number; +``` + +## Commit message format + +This repo uses [Conventional Commits](https://www.conventionalcommits.org). + +``` +type(scope): Message in present tense +``` + +`type` may be one of: + +- **feat** (A new feature) +- **fix** (A bug fix) +- **docs** (Documentation only changes) +- **style** (Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)) +- **refactor** (A code change that neither fixes a bug nor adds a feature) +- **perf** (A code change that improves performance) +- **test** (Adding missing tests or correcting existing tests) +- **chore** (Other changes that don't modify src or test file) + +`scope` indicates the package affected by the commit: + +- website +- core +- common +- etc. + +If a commit affects more than one package, separate them with a comma: + +```shell +fix(core,common): Fix the thing +``` + +```shell +You can use `yarn g:cz` to interactively prompt you on how to commit. +``` + +If a commit applies to no particular package (e.g. a tooling change in the root package.json), the scope can be omitted. + +#### Breaking Changes + +If your contribution includes any breaking changes (including any backwards-incompatible changes; backwards-incompatible changes to current behavior), please include a `BREAKING CHANGE` section in your commit message as per the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/#commit-message-with-both-and-breaking-change-footer). + +Please also make your pull request against the `major` branch rather than `master` in the case of breaking changes. + +Example: + +```shell +feat(core): Add new field to Customer + +Relates to #123. This commit adds the "foo" field to the Custom entity. + +BREAKING CHANGE: A DB migration will be required in order to add the new "foo" field to the customer table. +``` + +#### Linting + +Commit messages are linted on commit, so you'll know if your message is not quite right. + +## Setting up the dev environment + +After cloning the Hyperse repo, please follow the [Development guide](./README.md#development) in the README for instructions on how to get up and running locally. + +## Contributor License Agreement + +All contributors are required to agree to the [Contributor License Agreement](https://github.com/hyperse-io/.github/blob/main/license/CLA.md) before their contributions can be merged. + +This is done via an automation bot which will prompt you to sign the CLA when you open a pull request. diff --git a/README.md b/README.md index 372bc01..38d221f 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ GitHub top language - + Licence

@@ -48,14 +48,75 @@ npm i @hyperse/track yarn add @hyperse/track ``` +## Development + +> [!IMPORTANT] +> The following instructions are for those who want to develop the hyperse related framework or plugins (e.g. if you intend to make a pull request). For instructions on how to build a project _using_ Hyperse, please see the [Getting Started guide](https://hyperse-io.github.io/docusaurus-mono-starter/docs/community/contributing). + +### 1. Clone project to the local directory + +```bash +git clone https://github.com/hyperse-io/track.git +``` + +### 2. Install dependencies in the root directory + +```bash +yarn install +``` + +or + +```bash +npm install +``` + +The root directory has a `package.json` which contains build-related dependencies for tasks including: + +- Building & deploying the docs +- Project for online presentation +- Linting, formatting & testing tasks to run on git commit & push + +### 3. Testing + +Make sure to thoroughly test your changes before submitting them. This includes running unit tests, integration tests, and any other relevant testing methods to ensure code quality and functionality. + +The core and several other packages have unit tests which are can be run all together by running `npm run test` from the root directory, or individually by running it from the package directory. + +Unit tests are co-located with the files which they test, and have the suffix `.spec.ts`. + +### 4. Improve documentation + +Documentation is a critical part of any software project. To improve or update the documentation: + +1. Update Documentation Files: If your changes introduce new features, modify existing functionality, or fix bugs, update the relevant documentation files located in the /website directory. + +2. Build and Preview: Ensure that your documentation builds correctly and looks good by running: + +```bash +cd website + +npm run start +``` + +3. Commit Documentation Changes: Make sure all updates to documentation are committed alongside your code changes. + +### 5. Release Process + +To make a release: + +1. Commit the Changes: Push your updated files to your branch. + +2. Create a Pull Request: [Open a pull request (PR)](https://github.com/hyperse-io/docusaurus-mono-starter/compare) with your changes. Make sure to include a clear description of what has been updated and why. + +3. GitHub Actions: Once the PR is merged into the main branch, the release process will be automatically handled by GitHub Actions. This includes tasks such as publishing to npm and updating documentation. + ## Documentation You can find the Track documentation [on the website](https://hyperse-io.github.io/docusaurus-mono-starter/). -## Contributing - -Contributions are welcome! If you encounter any issues or have ideas for improvements, feel free to open an issue or submit a pull request. +Check out the [Sample Example](https://hyperse-io.github.io/docusaurus-mono-starter/docs/intro/sample-example) page for a quick start. ## License -Code released under [LICENSE](https://github.com/hyperse-io/docusaurus-mono-starter/blob/main/LICENSE) +See [LICENSE](https://github.com/hyperse-io/docusaurus-mono-starter/blob/main/LICENSE.md)