-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add github ci template and test workflow
- Loading branch information
1 parent
ca79ceb
commit bba0ccc
Showing
10 changed files
with
1,455 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
extends: ['@commitlint/config-conventional'] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: "\U0001F41E Bug report" | ||
description: Create a report to help us improve | ||
labels: ['bug: pending triage'] | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
"Thanks for taking the time to fill out this bug report! | ||
IslandJS is still WIP, and it is not compatible with VuePress. | ||
Please do not open issue about default theme missing features or something doesn't work like IslandJS." | ||
- type: textarea | ||
id: bug-description | ||
attributes: | ||
label: Describe the bug | ||
description: A clear and concise description of what the bug is. If you intend to submit a PR for this issue, tell us in the description. Thanks! | ||
placeholder: Bug description | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: reproduction | ||
attributes: | ||
label: Reproduction | ||
description: Steps to reproduce the behavior | ||
placeholder: Reproduction | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: expected | ||
attributes: | ||
label: Expected behavior | ||
description: A clear and concise description of what you expected to happen. | ||
placeholder: Expected behavior | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: system-info | ||
attributes: | ||
label: System Info | ||
description: Output of `npx envinfo --system --npmPackages islandjs --binaries --browsers` | ||
render: shell | ||
placeholder: System, Binaries, Browsers | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: additional-context | ||
attributes: | ||
label: Additional context | ||
description: Add any other context or screenshots about the bug report here. | ||
- type: checkboxes | ||
id: checkboxes | ||
attributes: | ||
label: Validations | ||
description: Before submitting the issue, please make sure you do the following | ||
options: | ||
required: true | ||
- label: Read the [docs](https://island.sanyuan0704.top). | ||
required: true | ||
- label: Check that there isn't already an issue that reports the same bug to avoid creating a duplicate. | ||
required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: "\U0001F680 New feature proposal" | ||
description: Suggest an idea for this project | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Thanks for your interest in the project and taking the time to fill out this feature report! | ||
- type: textarea | ||
id: feature-description | ||
attributes: | ||
label: Is your feature request related to a problem? Please describe. | ||
description: "A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]" | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: suggested-solution | ||
attributes: | ||
label: Describe the solution you'd like | ||
description: A clear and concise description of what you want to happen. | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: alternative | ||
attributes: | ||
label: Describe alternatives you've considered | ||
description: A clear and concise description of any alternative solutions or features you've considered. | ||
- type: textarea | ||
id: additional-context | ||
attributes: | ||
label: Additional context | ||
description: Add any other context or screenshots about the feature request here. | ||
- type: checkboxes | ||
id: checkboxes | ||
attributes: | ||
label: Validations | ||
description: Before submitting the issue, please make sure you do the following | ||
options: | ||
- label: Read the [docs](https://island.sanyuan0704.top). | ||
required: true | ||
- label: Read the [Contributing Guidelines](https://github.com/sanyuan0704/island/blob/main/.github/contributing.md). | ||
required: true | ||
- label: Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate. | ||
required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
## Git Commit Message Convention | ||
|
||
> This is adapted from [Angular's commit convention](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular). | ||
#### TL;DR: | ||
|
||
Messages must be matched by the following regex: | ||
|
||
```js | ||
/^(revert: )?(feat|fix|docs|dx|style|refactor|perf|test|workflow|build|ci|chore|types|wip)(\(.+\))?: .{1,50}/ | ||
``` | ||
|
||
#### Examples | ||
|
||
Appears under "Features" header, `theme` subheader: | ||
|
||
``` | ||
feat(theme): add home page feature | ||
``` | ||
|
||
Appears under "Bug Fixes" header, `theme` subheader, with a link to issue #28: | ||
|
||
``` | ||
fix(theme): remove underline on sidebar hover style | ||
close #28 | ||
``` | ||
|
||
Appears under "Performance Improvements" header, and under "Breaking Changes" with the breaking change explanation: | ||
|
||
``` | ||
perf: improve store getters performance by removing 'foo' option | ||
BREAKING CHANGE: The 'foo' option has been removed. | ||
``` | ||
|
||
The following commit and commit `667ecc1` do not appear in the changelog if they are under the same release. If not, the revert commit appears under the "Reverts" header. | ||
|
||
``` | ||
revert: feat(theme): add home page feature | ||
This reverts commit 667ecc1654a317a13331b17617d973392f415f02. | ||
``` | ||
|
||
### Full Message Format | ||
|
||
A commit message consists of a **header**, **body** and **footer**. The header has a **type**, **scope** and **subject**: | ||
|
||
``` | ||
<type>(<scope>): <subject> | ||
<BLANK LINE> | ||
<body> | ||
<BLANK LINE> | ||
<footer> | ||
``` | ||
|
||
The **header** is mandatory and the **scope** of the header is optional. | ||
|
||
### Revert | ||
|
||
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body, it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted. | ||
|
||
### Type | ||
|
||
If the prefix is `feat`, `fix` or `perf`, it will appear in the changelog. However, if there is any [BREAKING CHANGE](#footer), the commit will always appear in the changelog. | ||
|
||
Other prefixes are up to your discretion. Suggested prefixes are `docs`, `chore`, `style`, `refactor`, and `test` for non-changelog related tasks. | ||
|
||
### Scope | ||
|
||
The scope could be anything specifying the place of the commit change. For example `theme`, `compiler`, `ssr`, etc... | ||
|
||
### Subject | ||
|
||
The subject contains a succinct description of the change: | ||
|
||
- use the imperative, present tense: "change" not "changed" nor "changes" | ||
- don't capitalize the first letter | ||
- no dot (.) at the end | ||
|
||
### Body | ||
|
||
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes". | ||
The body should include the motivation for the change and contrast this with previous behavior. | ||
|
||
### Footer | ||
|
||
The footer should contain any information about **Breaking Changes** and is also the place to | ||
reference GitHub issues that this commit **Closes**. | ||
|
||
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Island.js Contributing Guide | ||
|
||
Hi! We're really excited that you are interested in contributing to Island.js. Before submitting your contribution, please make sure to take a moment and read through the following guidelines: | ||
|
||
- [Pull Request Guidelines](#pull-request-guidelines) | ||
|
||
## Pull Request Guidelines | ||
|
||
- Checkout a topic branch from the relevant branch, e.g. `master`, and merge back against that branch. | ||
|
||
- If adding a new feature: | ||
|
||
- Provide a convincing reason to add this feature. Ideally, you should open a suggestion issue first and have it approved before working on it. | ||
|
||
- If fixing bug: | ||
|
||
- Provide a detailed description of the bug in the PR. Live demo preferred. | ||
|
||
- It's OK to have multiple small commits as you work on the PR - GitHub can automatically squash them before merging. | ||
|
||
- Commit messages must follow the [commit message convention](./commit-convention.md) so that changelogs can be automatically generated. | ||
|
||
## Development Setup | ||
|
||
You will need [pnpm](https://pnpm.io) | ||
|
||
After cloning the repo, run: | ||
|
||
```sh | ||
# install the dependencies of the project | ||
$ pnpm install | ||
``` | ||
|
||
### Setup Island.js Dev Environment | ||
|
||
You can run following command to build the island cli: | ||
|
||
```sh | ||
$ pnpm run dev | ||
``` | ||
|
||
And then you can execute: | ||
|
||
```sh | ||
$ pnpm run docs:dev | ||
``` | ||
|
||
Visit http://localhost:5173 and try modifying the source code. You'll get live update. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Test | ||
|
||
env: | ||
# 7 GiB by default on GitHub, setting to 6 GiB | ||
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources | ||
NODE_OPTIONS: --max-old-space-size=6144 | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [14, 16, 18] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
|
||
- name: Set node version to ${{ matrix.node_version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node_version }} | ||
cache: 'pnpm' | ||
|
||
- name: Install deps | ||
run: pnpm install | ||
|
||
- name: Build | ||
run: pnpm run build | ||
|
||
- name: Lint | ||
run: pnpm run lint | ||
|
||
- name: Test unit | ||
run: pnpm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx --no -- commitlint --edit "$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx --no -- lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.