Skip to content

Commit 114721e

Browse files
committed
Merge branch 'main' into feat/shiki
2 parents 87f990a + 8fbffca commit 114721e

29 files changed

+2026
-736
lines changed

.github/CONTRIBUTING.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Contributing Guide
2+
3+
Thanks for lending a hand 👋
4+
5+
Here are a few ways to contribute:
6+
7+
- [Add a theme](../docs/themes.md#adding-theme)
8+
- [Add a language grammar](../docs/languages.md#adding-grammar)
9+
- Fix a bug
10+
11+
## Development
12+
13+
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:
14+
15+
```bash
16+
git clone --recursive https://github.com/shikijs/shiki
17+
```
18+
19+
Or if you have already cloned it, use:
20+
21+
```bash
22+
git submodule update --init --recursive
23+
```
24+
25+
Learn more at this [StackOverflow thread](https://stackoverflow.com/a/4438292).
26+
27+
## Coding conventions
28+
29+
- We use ESLint to lint and format the codebase. Before you commit, all files will be formatted automatically.
30+
- 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.
31+
- If adding a language, use `feat(lang)`
32+
- If adding a theme, use `feat(theme)`
33+
34+
## Fix a bug
35+
36+
- Reference the bug you are fixing in the PR
37+
- Add a test if possible

.github/FUNDING.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github: [antfu]
1+
github: [antfu, octref]

.github/pull_request_template.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
- [ ] Add a test if possible
2+
- [ ] Format all commit messages with [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
3+
4+
<!-- If fixing a bug -->
5+
6+
- [ ] This PR fixes #
7+
8+
<!-- If adding a theme -->
9+
10+
- [ ] I have read docs for [adding a theme](https://github.com/shikijs/shiki/blob/main/docs/themes.md#adding-theme).
11+
12+
<!-- If adding a language -->
13+
14+
- [ ] I have read docs for [adding a language](https://github.com/shikijs/shiki/blob/main/docs/languages.md#adding-grammar).
15+
- [ ] I have searched around and this is the most up-to-date, actively maintained version of the language grammar.
16+
- [ ] 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.

.github/workflows/ci.yml

+25-80
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,51 @@
11
name: CI
2-
32
on:
43
push:
54
branches:
65
- main
7-
86
pull_request:
97
branches:
108
- main
119

1210
jobs:
13-
lint:
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: actions/checkout@v4
17-
with:
18-
submodules: recursive
19-
20-
- name: Install pnpm
21-
uses: pnpm/action-setup@v2
22-
23-
- name: Set node
24-
uses: actions/setup-node@v4
25-
with:
26-
node-version: lts/*
27-
28-
- name: Setup
29-
run: npm i -g @antfu/ni
30-
31-
- name: Install
32-
run: nci
33-
34-
- name: Lint
35-
run: nr lint
36-
37-
typecheck:
38-
runs-on: ubuntu-latest
39-
steps:
40-
- uses: actions/checkout@v4
41-
with:
42-
submodules: recursive
43-
44-
- name: Install pnpm
45-
uses: pnpm/action-setup@v2
46-
47-
- name: Set node
48-
uses: actions/setup-node@v4
49-
with:
50-
node-version: lts/*
51-
52-
- name: Setup
53-
run: npm i -g @antfu/ni
54-
55-
- name: Install
56-
run: nci
57-
58-
- name: Build
59-
run: nr build
60-
61-
- name: Typecheck
62-
run: nr typecheck
63-
6411
test:
6512
runs-on: ${{ matrix.os }}
6613

6714
strategy:
6815
matrix:
69-
node: [lts/*]
70-
os: [ubuntu-latest, windows-latest, macos-latest]
71-
include:
72-
- node: 16.x
73-
os: ubuntu-latest
74-
- node: 18.x
75-
os: ubuntu-latest
76-
fail-fast: false
16+
os: [ubuntu-latest, windows-latest]
7717

7818
steps:
79-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@v3
20+
- uses: actions/setup-node@v3
8021
with:
81-
submodules: recursive
22+
node-version: lts/*
8223

83-
- name: Install pnpm
24+
- name: pnpm setup
8425
uses: pnpm/action-setup@v2
8526

86-
- name: Set node ${{ matrix.node }}
87-
uses: actions/setup-node@v4
88-
with:
89-
node-version: ${{ matrix.node }}
27+
- name: Install dependencies
28+
run: pnpm install
9029

91-
- name: Setup
92-
run: npm i -g @antfu/ni
30+
- run: pnpm run update
31+
- run: pnpm run build
32+
- run: pnpm run gen
33+
working-directory: ./packages/site
9334

94-
- name: Install
95-
run: nci
35+
- run: pnpm run test
9636

97-
- name: Build
98-
run: nr build
37+
- name: Install E2E test browsers
38+
if: runner.os != 'Windows'
39+
run: pnpm exec playwright install --with-deps chromium
9940

100-
- name: Test
101-
run: nr test --coverage
41+
- name: Run E2E tests
42+
if: runner.os != 'Windows'
43+
run: pnpm run test:e2e
10244

103-
- name: Upload coverage reports to Codecov
104-
uses: codecov/codecov-action@v3
105-
env:
106-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
45+
- name: Upload E2E results
46+
uses: actions/upload-artifact@v3
47+
if: runner.os != 'Windows'
48+
with:
49+
name: playwright-report
50+
path: playwright-report/
51+
retention-days: 30

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ lib-cov
99
logs
1010
node_modules
1111
temp
12+
tmp
1213
packages/shiki/src/assets/langs
1314
packages/shiki/src/assets/themes
1415
packages/shiki/src/assets/*.json

0 commit comments

Comments
 (0)