Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0e08ae1

Browse files
Merge branch 'dostonnabotov:main' into main
2 parents 19c9437 + 8743f53 commit 0e08ae1

File tree

23 files changed

+1713
-360
lines changed

23 files changed

+1713
-360
lines changed

‎.github/workflows/consolidate-snippets.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ jobs:
3535
git config --global user.email "action@github.com"
3636
git add public/consolidated/*
3737
git add public/icons/*
38-
git commit -m "Update consolidated snippets"
38+
git diff-index --quiet HEAD || git commit -m "Update consolidated snippets"
3939
git push
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Pre-commit checks
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '**'
7+
8+
jobs:
9+
pre-commit-checks:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 22
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
24+
- name: Run cspell
25+
run: npm run cspell
26+
27+
- name: Run lint
28+
run: npm run lint
29+
30+
- name: Run build
31+
run: npm run build

‎.husky/pre-commit‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
npm run cspell
12
npm run lint
23
npm run build

‎.prettierignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
node_modules
22
dist
3+
snippets
4+
public
35
.vite
46
coverage
57
package-lock.json

‎CONTRIBUTING.md‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,19 @@ console.log(formatDate(new Date())); // Output: '2024年12月10日'
7979
- Specify the language after the first set of backticks for syntax highlighting.
8080

8181
6. **Test your snippet:**
82-
- Ensure your code runs as expected.
82+
- Ensure your code runs as expected. \
83+
To test that your snippets are formatted correctly use the `snippets:check` script:
84+
```
85+
$ npm run snippets:check
86+
```
87+
It will return nothing if they are well formatted, otherwise it will tell you what the error is.
88+
89+
---
90+
To preview the snippets, you need to consolidate them, use the `snippets:consolidate` script:
91+
```
92+
$ npm run snippets:consolidate
93+
```
94+
It will update the snippets in the `/public` folder, making them available to the frontend.
8395
8496
Expected file structure:
8597

‎README.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,19 @@ Expected file structure:
8080

8181
> Please do **NOT** add or edit anything in `/public` folder. It will be used for consolidating snippets.
8282
83+
To test that your snippets are formatted correctly use the `snippets:check` script:
84+
```
85+
$ npm run snippets:check
86+
```
87+
It will return nothing if they are well formatted, otherwise it will tell you what the error is.
88+
89+
---
90+
To preview the snippets, you need to consolidate them, use the `snippets:consolidate` script:
91+
```
92+
$ npm run snippets:consolidate
93+
```
94+
It will update the snippets in the `/public` folder, making them available to the frontend.
95+
8396
For more details about adding new categories or programming languages, check out the [CONTRIBUTING.md](/CONTRIBUTING.md) file.
8497

8598
## Guidelines for Contributions

‎cspell-dict.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
quicksnip

‎cspell.json‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"dictionaryDefinitions": [
3+
{
4+
"name": "workspace",
5+
"path": "./cspell-dict.txt",
6+
"description": "Custom Workspace Dictionary",
7+
"addWords": true
8+
}
9+
],
10+
"dictionaries": ["workspace"],
11+
"ignorePaths": [
12+
"node_modules",
13+
"dist",
14+
"public"
15+
]
16+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /