Skip to content

Commit 9a8c3d6

Browse files
authored
doc: contributing & security (#21)
* doc: contributing & security * fix * nope * nope * tagline & getting started * fix review
1 parent ce5cdfc commit 9a8c3d6

39 files changed

+178
-51
lines changed

.github/workflows/benchmark.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@ jobs:
4949
- name: Run the benchmarks
5050
uses: CodSpeedHQ/action@v3
5151
with:
52-
run: cargo codspeed run && pnpm -C ./packages/benchmark-wasm run benchmark-codspeed && pnpm -C ./packages/language-server-tests-benchmarks run benchmark-codspeed
52+
run: cargo codspeed run && pnpm -C ./packages/benchmark-wasm run benchmark-codspeed && pnpm -C ./packages/ls-tests-benchmarks run benchmark-codspeed
5353
token: ${{ secrets.CODSPEED_TOKEN }}

CONTRIBUTING.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Contributing to Our Open Source Projects
2+
3+
First, a huge **thank you** for dedicating your time to helping us improve our projects 🧡
4+
5+
## Before Opening Issues
6+
7+
- **Do not report security vulnerabilities publicly** (e.g., in issues or discussions), please refer to our [security policy](https://github.com/web-lsp/weblsp/blob/main/SECURITY.md).
8+
- **Do not create issues for ideas or suggestions.** Instead, share your thoughts in our [GitHub Discussions](https://github.com/web-lsp/weblsp/discussions/categories/ideas).
9+
- **Do not create issues for questions.** Instead, ask your question in our [GitHub Discussions](https://github.com/web-lsp/weblsp/discussions/categories/q-a).
10+
- **Check for duplicates.** Look through existing issues and discussions to see if your topic has already been addressed.
11+
- Provide as much detail as possible. However, don’t worry if it’s incomplete—we will help refine it!
12+
13+
## Before submitting Pull Requests (PRs)
14+
15+
- **Check for duplicates.** Look through existing PRs to see if your changes have already been submitted.
16+
- **Avoid trivial changes.** Don't submit PRs for typos, grammar, or insignificant changes, as they will be **declined** without review.
17+
- PRs don't need to be perfect. Submit your best effort, and we will gladly assist in polishing the work.
18+
19+
## Code of Conduct
20+
21+
We’re committed to fostering a welcoming and respectful community. Any issue, PR, or discussion that violates our [code of conduct](https://github.com/web-lsp/weblsp/blob/main/CODE_OF_CONDUCT.md) will be deleted, and the authors will be **banned**.
22+
23+
---
24+
25+
Thank you once again for contributing, we deeply appreciate all contributions, no matter how small or big.

README.md

Lines changed: 46 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,60 @@
11
<picture>
2-
<source media="(prefers-color-scheme: dark)" srcset="./.github/assets/WEBlsp_logo_dark.svg" />
3-
<img alt="WEBlsp logo" src="./.github/assets/WEBlsp_logo_light.svg" />
2+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/web-lsp/weblsp/refs/heads/main/.github/assets/WEBlsp_logo_dark.svg" />
3+
<img alt="WEBlsp logo" src="https://raw.githubusercontent.com/web-lsp/weblsp/refs/heads/main/.github/assets/WEBlsp_logo_light.svg" />
44
</picture>
55

6-
A better Language Server for the Web, made with Rust.
6+
A language server for the Web.
77

8-
(Work In Progress) ~~It provides full-featured language support for HTML and CSS, including syntax highlighting, code completion, error checking, and more.~~ Compliant with the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/), WEBlsp is designed to work with any IDE that supports LSP. Build on top of ~~HTMLlsrs~~ and [CSSlsrs](https://github.com/web-lsp/csslsrs), our own modern, fast, and reliable Language Services.
8+
WEBlsp is an implementation of the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/) (Work In Progress) ~~providing full-featured language support for HTML and CSS, including code completion, diagnostics, hover, and more.~~ It uses ~~HTMLlsrs~~ and [CSSlsrs](https://github.com/web-lsp/weblsp/tree/main/crates/csslsrs), our own modern and fast language services, designed to be integrated into language servers written in Rust or via WebAssembly.
99

10-
## Crates
10+
## Quick Links
11+
12+
🐛 [Report a bug](https://github.com/web-lsp/weblsp/issues), please read our [contributing guidelines](https://github.com/web-lsp/weblsp/blob/main/CONTRIBUTING.md) and [code of conduct](https://github.com/web-lsp/weblsp/blob/main/CODE_OF_CONDUCT.md) first.
13+
14+
🚨 [Report a security vulnerability](https://github.com/web-lsp/weblsp/security/advisories/new), and be sure to review our [security policy](https://github.com/web-lsp/weblsp/blob/main/SECURITY.md).
15+
16+
💬 [Join the discussion](https://github.com/web-lsp/weblsp/discussions), if you have any questions, ideas, or suggestions.
17+
18+
## Development
19+
20+
### Getting Started
21+
22+
To get started with WEBlsp, you will need to install the following tools:
23+
24+
- [Rust](https://www.rust-lang.org/tools/install)
25+
- [Node.js](https://nodejs.org/en/download/)
26+
- [PNPM](https://pnpm.io/installation)
27+
- [Just](https://just.systems/)
28+
- [wasm-bindgen-cli](https://rustwasm.github.io/wasm-bindgen/) (optional, for building WASM binaries)
29+
- [wasm-opt](https://github.com/WebAssembly/binaryen) (optional, for WASM benchmarks and releases)
30+
31+
Useful commands:
32+
33+
| Command | Description |
34+
| ----------------- | ------------------------------------------------------- |
35+
| `just install` | Install NPM dependencies across all crates and packages |
36+
| `just build` | Build WEBlsp crate and every language services |
37+
| `just build-wasm` | Build WASM packages |
38+
| `just test` | Run tests for all crates and packages |
39+
| `just benchmark` | Run native, WASM, and E2E benchmarks |
40+
41+
### Crates
1142

1243
WEBlsp is a monorepo that contains the following crates (Rust packages):
1344

1445
| Name | Description | Crates.io | README |
1546
| --------- | ------------------------ | --------- | --------------------------------------- |
16-
| `weblsp` | The main Language Server | WIP | [README.md](./crates/weblsp/README.md) |
17-
| `csslsrs` | CSS Language Service | WIP | [README.md](./crates/csslsrs/README.md) |
47+
| `weblsp` | The main language server | WIP | [README.md](./crates/weblsp/README.md) |
48+
| `csslsrs` | CSS language service | WIP | [README.md](./crates/csslsrs/README.md) |
1849

19-
## Packages
50+
### Packages
2051

2152
Additionally, WEBlsp contains the following NPM packages (JavaScript packages):
2253

23-
| Name | Description | NPM | README |
24-
| ---------------- | ------------------------- | --- | ------------------------------------------------ |
25-
| `vscode` | WEBlsp VSCode extension | WIP | [README.md](./packages/vscode/README.md) |
26-
| `csslsrs` | WASM CSS Language Service | WIP | [README.md](./packages/csslsrs/README.md) |
27-
| `benchmark-wasm` | Benchmark WASM packages | WIP | [README.md](./packages/benchmark-wasm/README.md) |
54+
| Name | Description | NPM | README |
55+
| --------------------- | ------------------------------------------ | --- | ----------------------------------------------------- |
56+
| `vscode` | WEBlsp VSCode extension | WIP | [README.md](./packages/vscode/README.md) |
57+
| `csslsrs` | CSSlsrs API for JS/TS | WIP | [README.md](./packages/csslsrs/README.md) |
58+
| `benchmark-wasm` | Benchmark WASM packages | WIP | [README.md](./packages/benchmark-wasm/README.md) |
59+
| `ls-tests-benchmarks` | End-to-end tests and benchmarks for WEBlsp | WIP | [README.md](./packages/ls-tests-benchmarks/README.md) |
60+

SECURITY.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
The following versions of our projects are currently supported with security updates:
6+
7+
| Package | Version | Supported |
8+
| ------- | ------- | ------------------ |
9+
| WEBlsp | 0.x.x | :white_check_mark: |
10+
| CSSlsrs | 0.x.x | :white_check_mark: |
11+
12+
## What is a Security Vulnerability?
13+
14+
A security vulnerability is a flaw or weakness in a system's design, implementation, operation, or management that could be exploited to violate the system's security policy. (Source: OWASP)
15+
16+
Please note that we will not accept reports related to vulnerabilities in other software, such as the IDEs that use our server or our dependencies. Additionally, we reserve the right to close reports that describe scenarios deemed highly unlikely or far-fetched.
17+
18+
## Reporting a Vulnerability
19+
20+
We take security issues very seriously. If you discover a vulnerability, please report it through our private reporting form: [Report a Security Vulnerability](https://github.com/web-lsp/weblsp/security/advisories/new).
21+
22+
### Guidelines for Reporting
23+
24+
- Do **not** report vulnerabilities publicly via issues or discussions.
25+
- Please provide as much detail as possible about the vulnerability to help us investigate and resolve it quickly.
26+
27+
### What to Expect
28+
29+
- You will receive an acknowledgement of your report within **48 hours** (working days).
30+
- If the report is valid, in most cases, a fix will be published within **one week** of confirming the vulnerability.
31+
32+
Keep in mind that we are an open-source project, and our team is composed of volunteers. We will do our best to address the issue promptly, but we appreciate your understanding and patience.
33+
34+
### Post-Fix Communication
35+
36+
Once the fix is deployed, a **public security advisory** will be published here: [Security Advisories](https://github.com/web-lsp/weblsp/security/advisories). If applicable, credit will be given to the reporter for their responsible disclosure.
37+
38+
We greatly appreciate your efforts to help us maintain the security of our projects.

crates/csslsrs/README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
<picture>
2-
<source media="(prefers-color-scheme: dark)" srcset="../../.github/assets/CSSlsrs_logo_dark.svg" />
3-
<img alt="CSSlsrs logo" src="../../.github/assets/CSSlsrs_logo_light.svg" />
2+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/web-lsp/weblsp/refs/heads/main/.github/assets/CSSlsrs_logo_dark.svg" />
3+
<img alt="WEBlsp logo" src="https://raw.githubusercontent.com/web-lsp/weblsp/refs/heads/main/.github/assets/CSSlsrs_logo_light.svg" />
44
</picture>
55

6-
A CSS Language Service made with Rust.
6+
A language service for CSS.
77

8-
(Work In Progress) ~~It provides full-featured language support for CSS, including syntax highlighting, code completion, error checking, and more.~~ Compliant with the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/), CSSlsrs can be integrated into Language Servers written in Rust or JavaScript (via WebAssembly). Thanks to [Biome](https://biomejs.dev/)'s parser, we deliver a fast and efficient language service, designed to improve your productivity when working with CSS.
8+
(Work In Progress) ~~It provides full-featured language support, including code completion, diagnostics, hover, and more.~~ Compliant with the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/), CSSlsrs can be integrated into language servers written in Rust or via WebAssembly. We use [Biome](https://biomejs.dev/)'s CSS parser behind the scenes.
9+
10+
## Quick Links
11+
12+
📖 [Main repository](https://github.com/web-lsp/weblsp/), with all related crates and packages.
13+
14+
🐛 [Report a bug](https://github.com/web-lsp/weblsp/issues), please read our [contributing guidelines](https://github.com/web-lsp/weblsp/blob/main/CONTRIBUTING.md) and [code of conduct](https://github.com/web-lsp/weblsp/blob/main/CODE_OF_CONDUCT.md) first.
15+
16+
🚨 [Report a security vulnerability](https://github.com/web-lsp/weblsp/security/advisories/new), and be sure to review our [security policy](https://github.com/web-lsp/weblsp/blob/main/SECURITY.md).
17+
18+
💬 [Join the discussion](https://github.com/web-lsp/weblsp/discussions), if you have any questions, ideas, or suggestions.
919

1020
## Features
1121

crates/csslsrs/src/service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::{
77
use lsp_types::{TextDocumentItem, Uri};
88
use serde::{Deserialize, Serialize};
99

10-
/// The Language Service is the main entry point for interacting with CSSlsrs.
10+
/// The language service is the main entry point for interacting with CSSlsrs.
1111
/// It contains a DocumentStore, a PositionEncoding and a reference to the CSS data.
1212
pub struct LanguageService {
1313
pub(crate) store: DocumentStore,

crates/weblsp/README.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
<picture>
2-
<source media="(prefers-color-scheme: dark)" srcset="../../.github/assets/WEBlsp_logo_dark.svg" />
3-
<img alt="WEBlsp logo" src=".../../.github/assets/WEBlsp_logo_light.svg" />
2+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/web-lsp/weblsp/refs/heads/main/.github/assets/WEBlsp_logo_dark.svg" />
3+
<img alt="WEBlsp logo" src="https://raw.githubusercontent.com/web-lsp/weblsp/refs/heads/main/.github/assets/WEBlsp_logo_light.svg" />
44
</picture>
55

6-
A better Language Server for the Web, made with Rust.
6+
A language server for the Web.
77

8-
(Work In Progress) ~~It provides full-featured language support for HTML and CSS, including syntax highlighting, code completion, error checking, and more.~~ Compliant with the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/), WEBlsp is designed to work with any IDE that supports LSP. Build on top of ~~HTMLlsrs~~ and [CSSlsrs](https://github.com/web-lsp/csslsrs), our own modern, fast, and reliable Language Services.
8+
WEBlsp is an implementation of the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/), using ~~HTMLlsrs~~ and [CSSlsrs](https://github.com/web-lsp/weblsp/tree/main/crates/csslsrs) behind the scenes. (Work In Progress) ~~It provides full-featured language support for HTML and CSS, including code completion, diagnostics, hover, and more.~~
99

10-
## TODO
10+
## Quick Links
1111

12-
- [x] LSP basic server
13-
- [ ] Handle request by language (HTML, CSS)
14-
- [x] CSS Language Service (CSSlsrs) integration
15-
- [ ] HTML Language Service (HTMLlsrs) integration
16-
- [ ] Publish VSCode extension
12+
📖 [Main repository](https://github.com/web-lsp/weblsp/), with all related crates and packages.
1713

18-
## Useful commands
14+
🐛 [Report a bug](https://github.com/web-lsp/weblsp/issues), please read our [contributing guidelines](https://github.com/web-lsp/weblsp/blob/main/CONTRIBUTING.md) and [code of conduct](https://github.com/web-lsp/weblsp/blob/main/CODE_OF_CONDUCT.md) first.
1915

20-
- `cargo build` - Build the project
21-
- `cd ./packages/vscode && pnpm run compile` - Compile the vscode extension
16+
🚨 [Report a security vulnerability](https://github.com/web-lsp/weblsp/security/advisories/new), and be sure to review our [security policy](https://github.com/web-lsp/weblsp/blob/main/SECURITY.md).
17+
18+
💬 [Join the discussion](https://github.com/web-lsp/weblsp/discussions), if you have any questions, ideas, or suggestions.

crates/weblsp/src/css.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ use std::error::Error;
88

99
use crate::requests::cast;
1010

11-
/// Initialize our CSS Language Service (CSSlsrs).
11+
/// Initialize our CSS language service (CSSlsrs).
1212
/// Used once at the start of the main loop, so the document store stays alive throughout the server's lifetime.
1313
pub fn init_language_service() -> LanguageService {
1414
LanguageService::default()
1515
}
1616

1717
/// Handle WEBlsp's CSS requests. This function will be called by the main loop when a CSS request is received,
18-
/// and will dispatch the request to our CSS Language Service (CSSlsrs).
18+
/// and will dispatch the request to our CSS language service (CSSlsrs).
1919
pub fn handle_request(
2020
language_service: &mut LanguageService,
2121
connection: &Connection,

crates/weblsp/src/notifications.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub fn handle_notification(
1717
}
1818
"textDocument/didOpen" => {
1919
// didOpen notification carry a textDocument item, which contains the document's URI and languageId.
20-
// We can use this information to determine in which Language Service's store we should add the document.
20+
// We can use this information to determine in which language service's store we should add the document.
2121
let params: DidOpenTextDocumentParams =
2222
serde_json::from_value(notification.params).unwrap();
2323
match params.text_document.language_id.as_str() {

justfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ benchmark:
3333
cargo bench
3434
echo "Running WASM benchmarks..."
3535
pnpm -C ./packages/benchmark-wasm run benchmark --run
36-
echo "Running Language Server benchmarks..."
37-
pnpm -C ./packages/language-server-tests-benchmarks run benchmark --run
36+
echo "Running language server benchmarks..."
37+
pnpm -C ./packages/ls-tests-benchmarks run benchmark --run

0 commit comments

Comments
 (0)