Skip to content

Commit 06f7645

Browse files
Nikola HristovNikola Hristov
authored andcommitted
2 parents d5bec01 + a7f3fa3 commit 06f7645

369 files changed

Lines changed: 20120 additions & 529 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODE_OF_CONDUCT.md

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
- Demonstrating empathy and kindness toward other people
21+
- Being respectful of differing opinions, viewpoints, and experiences
22+
- Giving and gracefully accepting constructive feedback
23+
- Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
- Focusing on what is best not just for us as individuals, but for the
26+
overall community
27+
28+
Examples of unacceptable behavior include:
29+
30+
- The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
- Trolling, insulting or derogatory comments, and personal or political attacks
33+
- Public or private harassment
34+
- Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
- Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement.
63+
All complaints will be reviewed and investigated promptly and fairly.
64+
65+
All community leaders are obligated to respect the privacy and security of the
66+
reporter of any incident.
67+
68+
## Enforcement Guidelines
69+
70+
Community leaders will follow these Community Impact Guidelines in determining
71+
the consequences for any action they deem in violation of this Code of Conduct:
72+
73+
### 1. Correction
74+
75+
**Community Impact**: Use of inappropriate language or other behavior deemed
76+
unprofessional or unwelcome in the community.
77+
78+
**Consequence**: A private, written warning from community leaders, providing
79+
clarity around the nature of the violation and an explanation of why the
80+
behavior was inappropriate. A public apology may be requested.
81+
82+
### 2. Warning
83+
84+
**Community Impact**: A violation through a single incident or series
85+
of actions.
86+
87+
**Consequence**: A warning with consequences for continued behavior. No
88+
interaction with the people involved, including unsolicited interaction with
89+
those enforcing the Code of Conduct, for a specified period of time. This
90+
includes avoiding interactions in community spaces as well as external channels
91+
like social media. Violating these terms may lead to a temporary or
92+
permanent ban.
93+
94+
### 3. Temporary Ban
95+
96+
**Community Impact**: A serious violation of community standards, including
97+
sustained inappropriate behavior.
98+
99+
**Consequence**: A temporary ban from any sort of interaction or public
100+
communication with the community for a specified period of time. No public or
101+
private interaction with the people involved, including unsolicited interaction
102+
with those enforcing the Code of Conduct, is allowed during this period.
103+
Violating these terms may lead to a permanent ban.
104+
105+
### 4. Permanent Ban
106+
107+
**Community Impact**: Demonstrating a pattern of violation of community
108+
standards, including sustained inappropriate behavior, harassment of an
109+
individual, or aggression toward or disparagement of classes of individuals.
110+
111+
**Consequence**: A permanent ban from any sort of public interaction within
112+
the community.
113+
114+
## Attribution
115+
116+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
117+
version 2.0, available at
118+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
119+
120+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
121+
122+
[homepage]: https://www.contributor-covenant.org
123+
124+
For answers to common questions about this code of conduct, see the FAQ at
125+
https://www.contributor-covenant.org/faq. Translations are available at
126+
https://www.contributor-covenant.org/translations.

.github/SECURITY.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
## Reporting a Vulnerability
6+
7+
If you find any potential vulnerability, join our [discord channel](https://discord.gg/9uXCAwqQZW) and contact Boshen.

.github/actions/pnpm/action.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Pnpm
2+
3+
description: Install pnpm
4+
5+
runs:
6+
using: composite
7+
steps:
8+
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
9+
10+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
11+
with:
12+
node-version-file: .node-version
13+
cache: pnpm
14+
15+
- name: pnpm
16+
shell: bash
17+
run: |
18+
corepack enable
19+
pnpm install
20+
21+
- name: yarn
22+
shell: bash
23+
run: |
24+
cd fixtures/pnp
25+
corepack enable
26+
yarn install

.github/codecov.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
informational: true
6+
patch:
7+
default:
8+
informational: true
9+
changes:
10+
default:
11+
informational: true
12+
13+
ignore:
14+
- "examples"

.github/renovate.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": ["github>Boshen/renovate"],
4+
"ignorePaths": ["**/node_modules/**", "**/fixtures/**"],
5+
"packageRules": [
6+
{
7+
"groupName": "ignored crates",
8+
"matchManagers": ["cargo"],
9+
"matchPackageNames": ["thiserror"],
10+
"enabled": false
11+
}
12+
]
13+
}

.github/workflows/autofix.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: autofix.ci # For security reasons, the workflow in which the autofix.ci action is used must be named "autofix.ci".
2+
3+
permissions: {}
4+
5+
on:
6+
pull_request:
7+
types: [opened, synchronize]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
11+
cancel-in-progress: ${{ github.ref_name != 'main' }}
12+
13+
jobs:
14+
autofix:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
18+
19+
- uses: oxc-project/setup-rust@cd82e1efec7fef815e2c23d296756f31c7cdc03d # v1.0.0
20+
with:
21+
restore-cache: false
22+
tools: just,cargo-shear@1,dprint
23+
components: rustfmt
24+
25+
- name: Restore dprint plugin cache
26+
id: cache-restore
27+
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
28+
with:
29+
key: dprint-autofix-ci-${{ runner.os }}-${{ hashFiles('dprint.json') }}
30+
path: ~/.cache/dprint
31+
32+
- run: just fmt
33+
34+
- uses: autofix-ci/action@2891949f3779a1cafafae1523058501de3d4e944 # v1.3.1
35+
with:
36+
fail-fast: false
37+
38+
- name: Save dprint plugin cache
39+
if: ${{ github.ref_name == 'main' }}
40+
id: cache-save
41+
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
42+
with:
43+
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
44+
path: ~/.cache/dprint

.github/workflows/benchmark.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Benchmark
2+
3+
permissions: {}
4+
5+
on:
6+
workflow_dispatch:
7+
pull_request:
8+
types: [opened, synchronize]
9+
paths:
10+
- "src/*.rs"
11+
- "Cargo.lock"
12+
push:
13+
branches:
14+
- main
15+
paths:
16+
- "src/*.rs"
17+
- "Cargo.lock"
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
21+
cancel-in-progress: true
22+
23+
jobs:
24+
benchmark:
25+
name: Benchmark
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
29+
30+
- uses: oxc-project/setup-rust@cd82e1efec7fef815e2c23d296756f31c7cdc03d # v1.0.0
31+
with:
32+
cache-key: benchmark
33+
save-cache: ${{ github.ref_name == 'main' }}
34+
tools: cargo-codspeed
35+
36+
- uses: ./.github/actions/pnpm
37+
38+
- run: cargo codspeed build --features codspeed
39+
env:
40+
RUSTFLAGS: "-C debuginfo=1 -C strip=none"
41+
42+
- uses: CodSpeedHQ/action@0010eb0ca6e89b80c88e8edaaa07cfe5f3e6664d # v3.5.0
43+
timeout-minutes: 30
44+
with:
45+
run: cargo codspeed run
46+
token: ${{ secrets.CODSPEED_TOKEN }}

.github/workflows/ci.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: CI
2+
3+
permissions: {}
4+
5+
on:
6+
workflow_dispatch:
7+
pull_request:
8+
types: [opened, synchronize]
9+
paths-ignore:
10+
- "**/*.md"
11+
- "!.github/workflows/ci.yml"
12+
push:
13+
branches:
14+
- main
15+
paths-ignore:
16+
- "**/*.md"
17+
- "!.github/workflows/ci.yml"
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
21+
cancel-in-progress: ${{ github.ref_name != 'main' }}
22+
23+
defaults:
24+
run:
25+
shell: bash
26+
27+
jobs:
28+
test:
29+
name: Test
30+
strategy:
31+
fail-fast: true
32+
matrix:
33+
include:
34+
- os: windows-latest
35+
- os: ubuntu-latest
36+
- os: macos-14
37+
runs-on: ${{ matrix.os }}
38+
steps:
39+
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
40+
- uses: oxc-project/setup-rust@cd82e1efec7fef815e2c23d296756f31c7cdc03d # v1.0.0
41+
with:
42+
save-cache: ${{ github.ref_name == 'main' }}
43+
cache-key: warm
44+
- uses: ./.github/actions/pnpm
45+
- run: cargo check --all-features --locked
46+
- run: cargo test --doc
47+
- run: cargo test --all-features
48+
- run: pnpm run build:debug && pnpm run test
49+
if: ${{ matrix.os != 'windows-latest' }}
50+
51+
lint:
52+
name: Lint
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
56+
- uses: oxc-project/setup-rust@cd82e1efec7fef815e2c23d296756f31c7cdc03d # v1.0.0
57+
with:
58+
components: clippy rust-docs
59+
- run: cargo clippy --all-features --all-targets -- -D warnings
60+
- run: RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --all-features
61+
- uses: crate-ci/typos@0f0ccba9ed1df83948f0c15026e4f5ccfce46109 # v1.32.0
62+
with:
63+
files: .
64+
65+
wasm:
66+
name: Check Wasm
67+
runs-on: ubuntu-latest
68+
steps:
69+
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
70+
71+
- uses: oxc-project/setup-rust@cd82e1efec7fef815e2c23d296756f31c7cdc03d # v1.0.0
72+
with:
73+
cache-key: wasm
74+
save-cache: ${{ github.ref_name == 'main' }}
75+
76+
- name: Check
77+
run: |
78+
rustup target add wasm32-unknown-unknown
79+
cargo check --all-features --target wasm32-unknown-unknown
80+
81+
wasi:
82+
name: Test wasi target
83+
runs-on: ubuntu-latest
84+
steps:
85+
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
86+
87+
- uses: oxc-project/setup-rust@cd82e1efec7fef815e2c23d296756f31c7cdc03d # v1.0.0
88+
with:
89+
cache-key: wasi
90+
save-cache: ${{ github.ref_name == 'main' }}
91+
92+
- uses: ./.github/actions/pnpm
93+
94+
- name: Build
95+
run: |
96+
rustup target add wasm32-wasip1-threads
97+
pnpm build --target wasm32-wasip1-threads
98+
99+
- name: Test
100+
run: pnpm run test
101+
env:
102+
WASI_TEST: 1
103+
104+
- run: git diff --exit-code # Must commit index.d.ts

0 commit comments

Comments
 (0)