Skip to content

Commit

Permalink
Merge pull request #4 from hyperse-io/feat/doc
Browse files Browse the repository at this point in the history
Feat/doc
  • Loading branch information
tianyingchun authored Aug 22, 2024
2 parents affd9e3 + 801368d commit d4c2be5
Show file tree
Hide file tree
Showing 25 changed files with 636 additions and 153 deletions.
2 changes: 1 addition & 1 deletion ghpage.code-workspace → docusaurus.code-workspace
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"folders": [
{
"name": "gh-pages",
"name": "docusaurus",
"path": "./",
},
{
Expand Down
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"changelog": [
"@changesets/changelog-github",
{
"repo": "hyperse-io/gh-pages-starter"
"repo": "hyperse-io/docusaurus-mono-starter"
}
],
"commit": false,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-or-version-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
release:
# Basic security: the release job can only be executed from this repo and from the main branch (not a remote thing)
if: ${{ github.repository == 'hyperse-io/gh-pages-starter' && contains('refs/heads/main',github.ref)}}
if: ${{ github.repository == 'hyperse-io/docusaurus-mono-starter' && contains('refs/heads/main',github.ref)}}
name: Release and changelog
runs-on: ubuntu-latest

Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 1 addition & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1 @@
# @hyperse/gh-pages-starter

## 1.0.2

### Patch Changes

- [`9a36660`](https://github.com/hyperse-io/gh-pages-starter/commit/9a366605ec5104e47472d97d8ab115a7bf8c785c) Thanks [@tianyingchun](https://github.com/tianyingchun)! - Add code-coverage on changeset

## 1.0.1

### Patch Changes

- [`d9afa31`](https://github.com/hyperse-io/gh-pages-starter/commit/d9afa31e7c12aba68e0fc7fc629150f300c74372) Thanks [@tianyingchun](https://github.com/tianyingchun)! - initialize projects
# @hyperse/docusaurus-mono-starter
103 changes: 103 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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.
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

39 changes: 39 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# License

Copyright (C) Hyperse (Yuantai Information Technology (Shanghai) Co., Ltd)

This software is available under two different licenses:

- GNU General Public License version 3 (GPLv3) as Hyperse Community Edition
- Hyperse Commercial License (HCL)

The default Hyperse license, without a valid Hyperse Commercial License agreement, is the Open-Source GPLv3 license.

## GNU General Public License version 3 (GPLv3)

If you decide to choose the GPLv3 license, you must comply with the following terms:

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

## Hyperse Commercial License (HCL)

Alternatively, commercial and supported versions of the program - also known as
Commercial Distributions - must be used in accordance with the terms and conditions
contained in a separate written agreement between you and Hyperse GmbH.
For more information about the Hyperse Commercial License (HCL) please contact hi@hyperse.net.

Please see also:

- [Licensing FAQ - license-faq.md](https://github.com/hyperse-io/.github/blob/main/license/license-faq.md)
- [GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 - gpl-3.0.txt](https://github.com/hyperse-io/.github/blob/main/license/gpl-3.0.txt)
118 changes: 103 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# @hyperse/gh-pages-starter
<h1 align="left">docusaurus-mono-starter</h1>

<p align="left">
<a aria-label="Build" href="https://github.com/hyperse-io/gh-pages-starter/actions?query=workflow%3ACI">
<img alt="build" src="https://img.shields.io/github/actions/workflow/status/hyperse-io/gh-pages-starter/ci-integrity.yml?branch=main&label=ci&logo=github&style=flat-quare&labelColor=000000" />
<a aria-label="Build" href="https://github.com/hyperse-io/docusaurus-mono-starter/actions?query=workflow%3ACI">
<img alt="build" src="https://img.shields.io/github/actions/workflow/status/hyperse-io/docusaurus-mono-starter/ci-integrity.yml?branch=main&label=ci&logo=github&style=flat-quare&labelColor=000000" />
</a>
<a aria-label="stable version" href="https://www.npmjs.com/package/@hyperse/gh-pages-starter">
<img alt="stable version" src="https://img.shields.io/npm/v/%40hyperse%2Fgh-pages-starter?branch=main&label=version&logo=npm&style=flat-quare&labelColor=000000" />
<a aria-label="stable version" href="https://www.npmjs.com/package/@hyperse/docusaurus-mono-starter">
<img alt="stable version" src="https://img.shields.io/npm/v/%40hyperse%2Fdocusaurus-mono-starter?branch=main&label=version&logo=npm&style=flat-quare&labelColor=000000" />
</a>
<a>
<img alt="LoC" src="https://img.shields.io/bundlephobia/min/%40hyperse%2Fgh-pages-starter?style=flat-quare&labelColor=000000" />
<img alt="LoC" src="https://img.shields.io/bundlephobia/min/%40hyperse%2Fdocusaurus-mono-starter?style=flat-quare&labelColor=000000" />
</a>
<a aria-label="Top language" href="https://github.com/hyperse-io/gh-pages-starter/search?l=typescript">
<img alt="GitHub top language" src="https://img.shields.io/github/languages/top/hyperse-io/gh-pages-starter?style=flat-square&labelColor=000&color=blue">
<a aria-label="Top language" href="https://github.com/hyperse-io/docusaurus-mono-starter/search?l=typescript">
<img alt="GitHub top language" src="https://img.shields.io/github/languages/top/hyperse-io/docusaurus-mono-starter?style=flat-square&labelColor=000&color=blue">
</a>
<a aria-label="Licence" href="https://github.com/hyperse-io/gh-pages-starter/blob/main/LICENSE">
<img alt="Licence" src="https://img.shields.io/github/license/hyperse-io/gh-pages-starter?style=flat-quare&labelColor=000000" />
<a aria-label="Licence" href="https://github.com/hyperse-io/docusaurus-mono-starter/blob/main/LICENSE.md">
<img alt="Licence" src="https://img.shields.io/github/license/hyperse-io/docusaurus-mono-starter?style=flat-quare&labelColor=000000" />
</a>
</p>
<p align="left">
<img alt="Coverage: Statements" src="https://raw.githubusercontent.com/hyperse-io/gh-pages-starter/coverage/badges/statements.svg" />
<img alt="Coverage: Branches version" src="https://raw.githubusercontent.com/hyperse-io/gh-pages-starter/coverage/badges/branches.svg" />
<img alt="Coverage: Functions" src="https://raw.githubusercontent.com/hyperse-io/gh-pages-starter/coverage/badges/functions.svg" />
<img alt="Coverage: Lines" src="https://raw.githubusercontent.com/hyperse-io/gh-pages-starter/coverage/badges/lines.svg">
<img alt="Coverage: Statements" src="https://raw.githubusercontent.com/hyperse-io/docusaurus-mono-starter/coverage/badges/statements.svg" />
<img alt="Coverage: Branches version" src="https://raw.githubusercontent.com/hyperse-io/docusaurus-mono-starter/coverage/badges/branches.svg" />
<img alt="Coverage: Functions" src="https://raw.githubusercontent.com/hyperse-io/docusaurus-mono-starter/coverage/badges/functions.svg" />
<img alt="Coverage: Lines" src="https://raw.githubusercontent.com/hyperse-io/docusaurus-mono-starter/coverage/badges/lines.svg">
</a>
</p>

Expand All @@ -31,4 +31,92 @@

<table> <thead> <tr> <th align="center">Status</th> <th align="left">Category</th> <th align="right">Percentage</th> <th align="right">Covered / Total</th> </tr> </thead> <tbody> <tr> <td align="center">🔵</td> <td align="left">Lines</td> <td align="right">75%</td> <td align="right">6 / 8</td> </tr> <tr> <td align="center">🔵</td> <td align="left">Statements</td> <td align="right">75%</td> <td align="right">6 / 8</td> </tr> <tr> <td align="center">🔵</td> <td align="left">Functions</td> <td align="right">75%</td> <td align="right">3 / 4</td> </tr> <tr> <td align="center">🔵</td> <td align="left">Branches</td> <td align="right">75%</td> <td align="right">3 / 4</td> </tr> </tbody> </table>

The starter template for running Github Pages with docusaurus for document
## Prerequisites

Before you begin, make sure you have the following installed:

- Node.js (recommended version 16.x or higher)
- npm (comes with Node.js)

## Installation

```ts
// npm
npm i @hyperse/track

// yarn
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/).

Check out the [Sample Example](https://hyperse-io.github.io/docusaurus-mono-starter/docs/intro/sample-example) page for a quick start.

## License

See [LICENSE](https://github.com/hyperse-io/docusaurus-mono-starter/blob/main/LICENSE.md)
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hyperse/gh-pages-starter",
"version": "1.0.2",
"name": "@hyperse/docusaurus-mono-starter",
"version": "1.0.1",
"description": "The starter template for running Github Pages with docusaurus for document",
"keywords": [
"hyperse",
Expand All @@ -11,13 +11,13 @@
"Github Pages",
"github pages CI CD"
],
"homepage": "https://hyperse-io.github.io/gh-pages-starter",
"homepage": "https://hyperse-io.github.io/docusaurus-mono-starter",
"bugs": {
"url": "https://github.com/hyperse-io/gh-pages-starter/issues"
"url": "https://github.com/hyperse-io/docusaurus-mono-starter/issues"
},
"repository": {
"type": "git",
"url": "git@github.com:hyperse-io/gh-pages-starter.git"
"url": "git@github.com:hyperse-io/docusaurus-mono-starter.git"
},
"type": "module",
"exports": {
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { strCamelCase } from './str/str-camel-case.js';

export const ghPagesStarter = () => {
return strCamelCase('Hello World, ghPagesStarter!');
export const pagesStarter = () => {
return strCamelCase('Hello World, Docusaurus Mono!');
};
Loading

0 comments on commit d4c2be5

Please sign in to comment.