mirror of
https://github.com/tester-army/e2e.git
synced 2026-12-03 04:45:58 +08:00
* refactor(desktop): move the native driver into a root Cargo workspace (ENG-1543) The RFC in ENG-1543 puts every Rust crate under `crates/`, in one Cargo workspace with one lock file and one toolchain, so a second crate (`e2e-util`) can share them and link the same code. This is its first step, for the one crate there is today. - `packages/desktop/native` moves to `crates/e2e-desktop-napi`, and the crate is renamed to match (`e2e-desktop-napi`, so the library is `libe2e_desktop_napi.dylib`). - `Cargo.lock`, `rust-toolchain.toml`, and `rustfmt.toml` move to the root, and a root `Cargo.toml` declares the workspace (`crates/*`) and carries the release profile, which cargo reads only from the root. The lock file changes only by the rename. - A checkout build goes to the package directory, `packages/desktop/desktop.<platform>.node`, since `crates/` holds sources only. The loader and the driver test look there. - The scripts find the crate and the toolchain file at their new paths. `native-licenses.ts` starts its walk at the crate's own package, since `resolve.root` depends on the directory cargo runs in and is null at a workspace root. The notices list the same crates; only their header names the new lock file path. - The `native` CI job runs fmt, clippy, and tests for the whole workspace from the root; release takes the addons from the package directory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(scripts): move the native addon scripts to scripts/native (ENG-1543) The RFC in ENG-1543 has every NAPI addon built by one set of scripts, so `@e2e-dev/util` does not copy the desktop driver's. This moves `build-native.ts`, `cargo.ts`, `check-native.ts`, `native-licenses.ts`, and `place-native.ts` from `packages/desktop/scripts` to `scripts/native`. Each script now takes an addon's name first. `scripts/native/addons.ts` lists the addons: the crate that builds one, the npm package whose loader takes a checkout build, the file name, and the target triples with their platform names, from which the platform packages, the targets the license notices are resolved for, and the cdylib's file name follow. `desktop` is the only entry, with the same targets and paths as before. `pnpm --filter @e2e-dev/desktop build:native` and `licenses:native`, `pnpm build:desktop-native`, the platform packages' `prepublishOnly`, and the spec and release workflows call the new paths. The notices' header names the new script and says "addon", since util will ship one too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(desktop): keep the platform packages under packages/desktop/npm (ENG-1543) Every native addon ships one npm package per platform. Util will add about nine and desktop about four more once it runs on Windows and Linux, so a directory per platform package at the top of `packages/` would bury the packages people read. They move under the package that loads them, `packages/<package>/npm/<platform>`, the layout NAPI-RS generates: `packages/desktop-darwin-*` becomes `packages/desktop/npm/darwin-*`. The npm names do not change. - `pnpm-workspace.yaml` adds `packages/*/npm/*`, and `publicPackages()` reads those directories too, so the canary changeset, the peer-range, install-script, and changeset-bump checks still see the platform packages. Its test now requires one of them. - `scripts/native/addons.ts` places a platform package by the new rule. The platform packages' `prepublishOnly` and `repository.directory`, `build:desktop-native`, and `install-smoke.ts` use the new paths. - `@e2e-dev/desktop` publishes only `dist` and `NOTICE`, so `npm/` stays out of its tarball. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(desktop): require the checkout build in the native loader test (ENG-1543) The test runs only where a checkout build exists, but it accepted a platform package's version too. A loader that missed the checkout build at its new path would have loaded a platform package a canary left in the checkout and passed. It now requires `checkout build`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(scripts): reject inherited names as addons and targets (ENG-1543) `findAddon('constructor')` read `Object.prototype.constructor` as an addon and failed on a path instead of listing the addons, and `--target constructor` passed the target check and reached rustup. Both lookups take own keys only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
7 lines
234 B
TOML
7 lines
234 B
TOML
# The toolchain CI and a release build the driver with; rustup installs it on first use.
|
|
[toolchain]
|
|
channel = "1.100.0"
|
|
components = ["clippy", "rustfmt"]
|
|
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin"]
|
|
profile = "minimal"
|