-
-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
2,026 additions
and
736 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,37 @@ | ||
# Contributing Guide | ||
|
||
Thanks for lending a hand 👋 | ||
|
||
Here are a few ways to contribute: | ||
|
||
- [Add a theme](../docs/themes.md#adding-theme) | ||
- [Add a language grammar](../docs/languages.md#adding-grammar) | ||
- Fix a bug | ||
|
||
## Development | ||
|
||
This repository contains a [git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules) to `vscode-textmate`. By default `git clone` does not clone submodules. To clone this repository and its submodules, use: | ||
|
||
```bash | ||
git clone --recursive https://github.com/shikijs/shiki | ||
``` | ||
|
||
Or if you have already cloned it, use: | ||
|
||
```bash | ||
git submodule update --init --recursive | ||
``` | ||
|
||
Learn more at this [StackOverflow thread](https://stackoverflow.com/a/4438292). | ||
|
||
## Coding conventions | ||
|
||
- We use ESLint to lint and format the codebase. Before you commit, all files will be formatted automatically. | ||
- We use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). Please use a prefix. If your PR has multiple commits and some of them don't follow the Conventional Commits rule, we'll do a squash merge. | ||
- If adding a language, use `feat(lang)` | ||
- If adding a theme, use `feat(theme)` | ||
|
||
## Fix a bug | ||
|
||
- Reference the bug you are fixing in the PR | ||
- Add a test if possible |
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 |
---|---|---|
@@ -1 +1 @@ | ||
github: [antfu] | ||
github: [antfu, octref] |
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,16 @@ | ||
- [ ] Add a test if possible | ||
- [ ] Format all commit messages with [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) | ||
|
||
<!-- If fixing a bug --> | ||
|
||
- [ ] This PR fixes # | ||
|
||
<!-- If adding a theme --> | ||
|
||
- [ ] I have read docs for [adding a theme](https://github.com/shikijs/shiki/blob/main/docs/themes.md#adding-theme). | ||
|
||
<!-- If adding a language --> | ||
|
||
- [ ] I have read docs for [adding a language](https://github.com/shikijs/shiki/blob/main/docs/languages.md#adding-grammar). | ||
- [ ] I have searched around and this is the most up-to-date, actively maintained version of the language grammar. | ||
- [ ] I have added a sample file that includes a variety of language syntaxes and succinctly captures the idiosyncrasy of a language. See [docs](https://github.com/shikijs/shiki/blob/main/docs/languages.md#adding-grammar) for requirement. |
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 |
---|---|---|
@@ -1,106 +1,51 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
|
||
- name: Set node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
|
||
- name: Setup | ||
run: npm i -g @antfu/ni | ||
|
||
- name: Install | ||
run: nci | ||
|
||
- name: Lint | ||
run: nr lint | ||
|
||
typecheck: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
|
||
- name: Set node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
|
||
- name: Setup | ||
run: npm i -g @antfu/ni | ||
|
||
- name: Install | ||
run: nci | ||
|
||
- name: Build | ||
run: nr build | ||
|
||
- name: Typecheck | ||
run: nr typecheck | ||
|
||
test: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
node: [lts/*] | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
include: | ||
- node: 16.x | ||
os: ubuntu-latest | ||
- node: 18.x | ||
os: ubuntu-latest | ||
fail-fast: false | ||
os: [ubuntu-latest, windows-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
submodules: recursive | ||
node-version: lts/* | ||
|
||
- name: Install pnpm | ||
- name: pnpm setup | ||
uses: pnpm/action-setup@v2 | ||
|
||
- name: Set node ${{ matrix.node }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Setup | ||
run: npm i -g @antfu/ni | ||
- run: pnpm run update | ||
- run: pnpm run build | ||
- run: pnpm run gen | ||
working-directory: ./packages/site | ||
|
||
- name: Install | ||
run: nci | ||
- run: pnpm run test | ||
|
||
- name: Build | ||
run: nr build | ||
- name: Install E2E test browsers | ||
if: runner.os != 'Windows' | ||
run: pnpm exec playwright install --with-deps chromium | ||
|
||
- name: Test | ||
run: nr test --coverage | ||
- name: Run E2E tests | ||
if: runner.os != 'Windows' | ||
run: pnpm run test:e2e | ||
|
||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v3 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
- name: Upload E2E results | ||
uses: actions/upload-artifact@v3 | ||
if: runner.os != 'Windows' | ||
with: | ||
name: playwright-report | ||
path: playwright-report/ | ||
retention-days: 30 |
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.