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
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ The commands CI runs, in `.github/workflows/rust.yml`:
- [ ] `cargo clippy --workspace --all-targets --all-features -- -D warnings`
- [ ] `cargo test -p lyracore-importer`
- [ ] `cargo test -p lyracore-module --lib --features=debug_reducers`
- [ ] `cargo test -p lyracore-module --test build_script`
- [ ] `cargo test -p lyracore-module --test package_api_lint`
- [ ] `cargo test -p lyracore-package-delta`
- [ ] `cargo test -p lyracore-gateway`
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
# Share compiled dependencies while keeping each crate's result separate.
- run: cargo test -p lyracore-importer
- run: cargo test -p lyracore-module --lib --features=debug_reducers
- run: cargo test -p lyracore-module --test build_script
- run: cargo test -p lyracore-module --test package_api_lint
- run: cargo test -p lyracore-package-delta
- run: cargo test -p lyracore-gateway
Expand Down Expand Up @@ -84,9 +85,13 @@ jobs:
env:
BRANCH: ${{ github.head_ref || github.ref_name }}
run: |
if git ls-remote --exit-code --heads https://github.com/LyraCoreProject/packages "refs/heads/$BRANCH" >/dev/null; then
echo "ref=$BRANCH" >> "$GITHUB_OUTPUT"
if paired=$(git ls-remote --exit-code --heads https://github.com/LyraCoreProject/packages "refs/heads/$BRANCH"); then
echo "ref=${paired%%[[:space:]]*}" >> "$GITHUB_OUTPUT"
else
status=$?
if [ "$status" -ne 2 ]; then
exit "$status"
fi
echo "ref=main" >> "$GITHUB_OUTPUT"
fi
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand All @@ -98,4 +103,5 @@ jobs:
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
- name: Install the official Packages
run: for package in official-packages/*/; do ln -s "$PWD/$package" packages/; done
- run: cargo test -p lyracore-module --test package_api_lint
- run: cargo check --target wasm32-unknown-unknown -p lyracore-module --features=debug_reducers
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@ and is not reconstructed here.

## [Unreleased]

### Changed

- Package API version 3 has five roots: `actor`, `hooks`, `package`, `tables`, and
`script_binding`. Actor operations and observations replace direct dependencies on `chat`,
`combat`, `creatures`, `faction`, `gameobject`, `group`, `helpers`, `items`, `loot`, `nav`, `quest`,
`spell`, `stats`, `terrain`, `transfer`, `world`, and `xp`. Package setup, Config and encounters
move from `package_account`, `package_config`, and `encounter` to `package`. Debug fixtures and
unit-test helpers move to `package::fixture` and `package::test` with their existing gates.
Import table accessors and row types through `crate::tables`. See the
[Package API migration notes](docs/package-api.md#module-roots).
- The Package API lint now runs with `cargo test -p lyracore-module --test package_api_lint`.
Module code generation no longer runs the lint. CI checks installed Official Packages with
the named test as well as compiling them.

### Added

- **The Package API, version 1** — [`docs/package-api.md`](./docs/package-api.md) names what a
Expand Down
4 changes: 2 additions & 2 deletions CONTEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -978,8 +978,8 @@ _Avoid_: plugin, addon (when meaning the whole folder), mod, extension

**Package API**:
The part of the Module a Package may name, versioned and written down at `docs/package-api.md`. The
build lints every Package file against it and fails on a path outside it, so a core refactor breaks a
Package at compile time rather than on a live realm. It is a compatibility contract, never a
named `package_api_lint` test checks every Package Rust file against it and reports paths outside
that contract. CI runs it with the Official Packages installed. It is a compatibility contract, never a
sandbox: compiled Package code is trusted either way.
_Avoid_: SDK, plugin API, public API, allowlist

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ first commit. A maintainer then marks the issue `in progress`.

New content and behaviour beyond 1.12.1 live in a Package. `lyracore packages new <name>`
scaffolds one from the Reference Package ladder in the collection. Use `--from` to choose a rung. [`docs/package-api.md`](docs/package-api.md) lists what
a Package may call, and the build fails on anything else. The Official Package Collection,
a Package may call, and the `package_api_lint` test reports paths outside it. The Official Package Collection,
[LyraCoreProject/packages](https://github.com/LyraCoreProject/packages), takes pull requests under
its own contributing guide.

Expand Down
4 changes: 2 additions & 2 deletions CORE_TERMS.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ _Avoid_: plugin, addon (when meaning the whole folder), mod, extension

**Package API**:
The part of the Module a Package may name, versioned and written down at `docs/package-api.md`. The
build lints every Package file against it and fails on a path outside it, so a core refactor breaks a
Package at compile time rather than on a live realm. It is a compatibility contract, never a
named `package_api_lint` test checks every Package Rust file against it and reports paths outside
that contract. CI runs it with the Official Packages installed. It is a compatibility contract, never a
sandbox: compiled Package code is trusted either way.
_Avoid_: SDK, plugin API, public API, allowlist

Expand Down
5 changes: 3 additions & 2 deletions docs/module-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ facade re-export, which the scanner checks. Package paths resolve through their
`#![cfg(feature = "debug_reducers")]`; discovery observes that gate so an ordinary build cannot
reference a function omitted by Rust.

Package source also passes the Package API lint described in `docs/package-api.md`. A path outside
`PACKAGE_API_ROOTS` fails with the Package, file, line, and path. An explicit
The separate `package_api_lint` test checks Package source as described in `docs/package-api.md`.
Code generation does not run this lint. CI runs it after installing the Official Packages. A path outside
the five documented Package API roots fails with the Package, file, line, and path. An explicit
`// package-api: exempt <reason>` permits an ordinary boundary exception. A gated API root still
requires its debug or test gate, and exemptions cannot bypass that requirement. Core source does
not pass through this lint.
Loading
Loading