Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/setup-workspace/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inputs:
node-version:
description: Node.js version to install.
required: false
default: '25'
default: '26'

runs:
using: composite
Expand Down
89 changes: 89 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Rust

on:
pull_request:
branches: [main, feat/*]
paths:
- 'Cargo.toml'
- 'Cargo.lock'
- 'rustfmt.toml'
- 'src/**'
- 'tests/**'
- 'benches/**'
- '.github/workflows/rust.yml'
push:
branches: [main, feat/*]
paths:
- 'Cargo.toml'
- 'Cargo.lock'
- 'rustfmt.toml'
- 'src/**'
- 'tests/**'
- 'benches/**'
- '.github/workflows/rust.yml'

permissions:
contents: read

concurrency:
group: rust-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

env:
CARGO_TERM_COLOR: always

jobs:
fmt:
name: Format
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v7.0.1

- name: Install Rust
run: rustup toolchain install stable --profile minimal --component rustfmt && rustup default stable

- name: Check formatting
run: cargo fmt --check

# The wasm guest is its own workspace, so the root `cargo fmt` skips it.
- name: Check formatting of the wasm guest
run: cargo fmt --check --manifest-path tests/wasm/ts/Cargo.toml

clippy:
name: Clippy
runs-on: ubuntu-latest
timeout-minutes: 20

steps:
- uses: actions/checkout@v7.0.1

- name: Install Rust
run: rustup toolchain install stable --profile minimal --component clippy && rustup default stable

- uses: Swatinem/rust-cache@v2.9.2

- name: Clippy (all features)
run: cargo clippy --locked --all-targets --all-features -- -D warnings

# The library on its own, as users with `default-features = false` build it.
- name: Clippy (no default features)
run: cargo clippy --locked --all-targets --no-default-features -- -D warnings

test:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- uses: actions/checkout@v7.0.1

# tests/wasm.rs builds the guest in tests/wasm/ts for wasm32-wasip2.
- name: Install Rust
run: rustup toolchain install stable --profile minimal --target wasm32-wasip2 && rustup default stable

- uses: Swatinem/rust-cache@v2.9.2

- name: Test
run: cargo test --locked --all-features
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,20 @@ dist/
openapi.json
openapi.*.json
**/openapi.forge.json

# Build output. Every member of the workspace builds into the target
# directory at its root.
/target

# Backups left by rustfmt.
**/*.rs.bk

# Debug information from MSVC builds on Windows.
*.pdb

# Coverage profiles from -C instrument-coverage.
*.profraw
*.profdata

# Mutation testing results from cargo-mutants.
/mutants.out*/
2 changes: 1 addition & 1 deletion .oxfmtrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"tabWidth": 2,
"useTabs": false,
"endOfLine": "lf",
"ignorePatterns": ["**/_generated/**", "dist", ".wrangler"]
"ignorePatterns": ["**/_generated/**", "dist", ".wrangler", "Cargo.toml"]
}
187 changes: 187 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["typescript", "unicorn", "oxc", "import"],
"rules": {
"curly": ["error", "all"],
"no-unused-vars": "warn",
"no-console": "off",
"eqeqeq": "error",
"typescript/no-floating-promises": "warn",
"typescript/no-misused-promises": "warn"
},
"ignorePatterns": ["node_modules", "dist", "**/_generated/**", ".wrangler"],
"overrides": [
{
"files": ["packages/astro-fern/**", "packages/docs-site/**", "packages/fern-forge/**"],
"rules": {
"curly": "off"
}
},
{
"files": ["src/bin/forge/ts/lib/**"],
"plugins": ["typescript", "unicorn", "oxc", "import", "node"],
"rules": {
"block-scoped-var": "error",
"constructor-super": "error",
"for-direction": "error",
"getter-return": "error",
"import/default": "error",
"import/namespace": "error",
"import/no-absolute-path": "error",
"import/no-empty-named-blocks": "error",
"import/no-named-as-default": "error",
"import/no-named-as-default-member": "error",
"import/no-self-import": "error",
"import/no-unassigned-import": "error",
"no-async-promise-executor": "error",
"no-caller": "error",
"no-class-assign": "error",
"no-compare-neg-zero": "error",
"no-cond-assign": "error",
"no-const-assign": "error",
"no-constant-binary-expression": "error",
"no-constant-condition": "error",
"no-control-regex": "error",
"no-debugger": "error",
"no-delete-var": "error",
"no-dupe-class-members": "error",
"no-dupe-else-if": "error",
"no-dupe-keys": "error",
"no-duplicate-case": "error",
"no-empty-character-class": "error",
"no-empty-pattern": "error",
"no-empty-static-block": "error",
"no-eval": "error",
"no-ex-assign": "error",
"no-extend-native": "error",
"no-extra-bind": "error",
"no-extra-boolean-cast": "error",
"no-func-assign": "error",
"no-global-assign": "error",
"no-implied-eval": "error",
"no-import-assign": "error",
"no-invalid-regexp": "error",
"no-irregular-whitespace": "error",
"no-iterator": "error",
"no-loss-of-precision": "error",
"no-misleading-character-class": "error",
"no-new": "error",
"no-new-native-nonconstructor": "error",
"no-nonoctal-decimal-escape": "error",
"no-obj-calls": "error",
"no-self-assign": "error",
"no-setter-return": "error",
"no-shadow": "error",
"no-shadow-restricted-names": "error",
"no-sparse-arrays": "error",
"no-this-before-super": "error",
"no-unassigned-vars": "error",
"no-underscore-dangle": "error",
"no-unexpected-multiline": "error",
"no-unmodified-loop-condition": "error",
"no-unneeded-ternary": "error",
"no-unreachable": "error",
"no-unsafe-finally": "error",
"no-unsafe-negation": "error",
"no-unsafe-optional-chaining": "error",
"no-unused-expressions": "error",
"no-unused-labels": "error",
"no-unused-private-class-members": "error",
"no-unused-vars": "error",
"no-useless-backreference": "error",
"no-useless-catch": "error",
"no-useless-concat": "error",
"no-useless-constructor": "error",
"no-useless-escape": "error",
"no-useless-rename": "error",
"no-with": "error",
"node/no-exports-assign": "error",
"oxc/approx-constant": "error",
"oxc/bad-array-method-on-arguments": "error",
"oxc/bad-char-at-comparison": "error",
"oxc/bad-comparison-sequence": "error",
"oxc/bad-match-all-arg": "error",
"oxc/bad-min-max-func": "error",
"oxc/bad-object-literal-comparison": "error",
"oxc/bad-replace-all-arg": "error",
"oxc/const-comparisons": "error",
"oxc/double-comparisons": "error",
"oxc/erasing-op": "error",
"oxc/misrefactored-assign-op": "error",
"oxc/missing-throw": "error",
"oxc/no-async-endpoint-handlers": "error",
"oxc/no-this-in-exported-function": "error",
"oxc/number-arg-out-of-range": "error",
"oxc/only-used-in-recursion": "error",
"oxc/uninvoked-array-callback": "error",
"preserve-caught-error": "error",
"require-yield": "error",
"typescript/await-thenable": "error",
"typescript/consistent-return": "error",
"typescript/no-array-delete": "error",
"typescript/no-base-to-string": "error",
"typescript/no-confusing-non-null-assertion": "error",
"typescript/no-duplicate-enum-values": "error",
"typescript/no-duplicate-type-constituents": "error",
"typescript/no-extra-non-null-assertion": "error",
"typescript/no-extraneous-class": "error",
"typescript/no-floating-promises": "error",
"typescript/no-for-in-array": "error",
"typescript/no-generated-empty-object-type": "error",
"typescript/no-implied-eval": "error",
"typescript/no-meaningless-void-operator": "error",
"typescript/no-misused-new": "error",
"typescript/no-misused-spread": "error",
"typescript/no-non-null-asserted-optional-chain": "error",
"typescript/no-redundant-type-constituents": "error",
"typescript/no-this-alias": "error",
"typescript/no-unnecessary-boolean-literal-compare": "error",
"typescript/no-unnecessary-parameter-property-assignment": "error",
"typescript/no-unnecessary-template-expression": "error",
"typescript/no-unnecessary-type-arguments": "error",
"typescript/no-unnecessary-type-assertion": "error",
"typescript/no-unnecessary-type-constraint": "error",
"typescript/no-unnecessary-type-conversion": "error",
"typescript/no-unnecessary-type-parameters": "error",
"typescript/no-unsafe-declaration-merging": "error",
"typescript/no-unsafe-enum-comparison": "error",
"typescript/no-unsafe-type-assertion": "error",
"typescript/no-unsafe-unary-minus": "error",
"typescript/no-useless-default-assignment": "error",
"typescript/no-useless-empty-export": "error",
"typescript/no-wrapper-object-types": "error",
"typescript/prefer-as-const": "error",
"typescript/prefer-namespace-keyword": "error",
"typescript/require-array-sort-compare": "error",
"typescript/restrict-template-expressions": "error",
"typescript/triple-slash-reference": "error",
"typescript/unbound-method": "error",
"unicorn/consistent-function-scoping": "error",
"unicorn/no-accessor-recursion": "error",
"unicorn/no-array-fill-with-reference-type": "error",
"unicorn/no-array-reverse": "error",
"unicorn/no-array-sort": "error",
"unicorn/no-await-in-promise-methods": "error",
"unicorn/no-confusing-array-with": "error",
"unicorn/no-empty-file": "error",
"unicorn/no-instanceof-builtins": "error",
"unicorn/no-invalid-fetch-options": "error",
"unicorn/no-invalid-remove-event-listener": "error",
"unicorn/no-new-array": "error",
"unicorn/no-single-promise-in-promise-methods": "error",
"unicorn/no-thenable": "error",
"unicorn/no-unnecessary-await": "error",
"unicorn/no-useless-fallback-in-spread": "error",
"unicorn/no-useless-length-check": "error",
"unicorn/no-useless-spread": "error",
"unicorn/prefer-add-event-listener": "error",
"unicorn/prefer-set-size": "error",
"unicorn/prefer-string-starts-ends-with": "error",
"unicorn/require-module-specifiers": "error",
"unicorn/require-post-message-target-origin": "error",
"use-isnan": "error",
"valid-typeof": "error"
}
}
]
}
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ API documentation site for Forge OpenAPI specs, built on Astro.
## Conventions

- **Open Source Separation**: Generic packages (`astro-fern`, `fern-forge`) must remain free of Cloudflare-specific dependencies.
- **Formatting & Linting**: `oxfmt` and `oxlint` via `pnpm check`.
- **Formatting & Linting**: `oxfmt` and `oxlint`, configured only at the root (`.oxfmtrc.json`, `.oxlintrc.json`). `pnpm check` verifies; `pnpm format` rewrites.
- **Type Checking**: Strict TypeScript compiler settings across all packages via `pnpm typecheck`.
- **Tests**: Node-native test runner via `pnpm test` (or `pnpm -r run test`).

Expand Down
Loading
Loading