Repository navigation
fix: CLI 1.2.0, shared readable workspace, gRPC reference docs - #9
Merged
Merged
Conversation
Add canonical scenario storage and delivery controls, harden Electron IPC and transports, improve large-workspace indexing, and publish readable protocol references.
The standalone CLI copied hoisted packages only, so protobufjs 7 under @grpc/proto-loader lost its @protobufjs/* dependencies and gateway/proto commands failed with "Cannot find module '@protobufjs/aspromise'". Packages are now resolved from the requiring package's node_modules chain. The release script verifies the bundled dependency closure and runs schema:import, mock:check and gateway:list against the packaged binary.
…files - Web Access mock streams follow loop/maxLoops like the native mock instead of ending after one pass. - Scenarios match the proto method name (PascalCase); 1.1.x camelCase names keep matching. - gateway:list normalizes profiles, so profiles without upstreams work. - YAML: a colon separates key and value only when followed by whitespace, so unquoted URLs stay plain values. - The drain test waits for completion instead of a fixed 15 ms, which is shorter than one Windows timer tick under load.
Files and folders were named <slug>--<hash> (and gRPC scenarios by two SHA-256 prefixes), which is hard to review in git. Paths are now built from entity names, and an id suffix is added only when siblings share a name: mocks/grpc/scenarios/<package.Service>/<Method>/<scenario-id>.scenario.yml collections/<collection>/<folder>/<request>.grpc.yml gateways/<name>.gateway.yml protos/<library>/revisions/<label> Workspaces written by earlier builds are renamed on the next save or workspace:format; hash-named scenario files move to their readable path the first time the scenario repository opens the workspace.
- layang run uses a request's timeoutMs and transport.mode unless --timeout or --transport is given; the target follows the transport. - gRPC-Web server streams use grpc-web-text and are read frame by frame, so streams through Layang's own gateway work, an endless stream ends at the deadline with the messages received (DEADLINE_EXCEEDED), and --max-messages stops it with OK. - A desktop tab opened from a saved request is not a second run item, so --collection/--request see each saved request once.
Opening a workspace rebuilt every collection request from the fields the editor knows and saved it back, which dropped assertions, defaults.environment and transport.mode from CLI-authored requests. The normalizer now keeps them (plus formFields, nativeTargetRef and extensions), and opening a request uses its saved transport, environment and assertions. REST defaults (auth: none, bodyType: json) are no longer written into gRPC/WebSocket requests.
- docs:build writes docs/published/grpc/openapi.yaml: OpenAPI 3.1 with POST /<package.Service>/<Method>, schemas from the proto messages, x-grpc details, and each saved example as a request/response example pair (named alike; errors under default with x-grpc-status). - An example can name the gRPC mock scenario that answers it (example.mock.scenario); docs show it next to the example. - Examples stored next to a request (requestRef.id) appear in that request's docs and run with that request; the desktop app keeps the link and the mock scenario when it saves. - example:run --all accepts --collection, --request matches the request name, and example:create stores the example with the selected request and accepts --set mock=<scenario>. - Empty example documentation fields are not written.
The CLI rendered docs/settings.yml as written while the desktop app normalizes it (include* switches apply only in "custom" sections mode), so the two could publish different pages. docs:build now uses the same normalized settings.
The app reloads external changes only after seeing the same revision twice (~5 s); an autosave in that window wrote its older snapshot and deleted or reverted files the CLI, Git or an editor had just written (for example an example created by layang example:create). The main process records the folder revision when it opens or writes a workspace and refuses a save when the folder changed since; the renderer drops that snapshot and reloads at once. docs/build-manifest.yml is generated output and no longer counts as a change.
One request per RPC now holds every scenario. On a collection request the Saved requests menu saves, loads, renames and deletes that request's examples (<request>.examples/), so they run with layang example:run and appear in the docs; overwriting an example keeps its expectations and mock link. Loose tabs keep the workspace-wide saved-requests/. The Examples tab lists the open request's own examples, new examples are linked to the open request, and loading one fills that request's tab instead of opening a separate method tab.
Request pages follow the API's structure (Diataxis reference) with descriptions from proto comments (AIP-192): request and response field tables with types and enum values, named examples, a status-code table, layang commands to run them, and a proto excerpt with only the RPC and the types it uses. The desktop Docs preview and docs:build render the same page. - Leading // comments of any length, /** */ blocks and trailing comments document rpcs, messages, fields and enum values. - Types resolve per package, so two packages' SetMessageRequest no longer show whichever file was parsed last (fixes field tables and OpenAPI). - No placeholder text: without a proto comment a request has no summary instead of "Call <method>.", the index labels streams correctly instead of Unary, and saving no longer creates <request>.<kind>.md placeholder files (untouched ones are removed, edited ones kept).
_wspawnv joins arguments with spaces without quoting, so the bundled node received --collection "FE Main Display" as three arguments (and lost empty ones); filters, names and messages with spaces silently matched nothing. The launcher now builds the command line with the CommandLineToArgvW quoting rules and runs node with CreateProcessW, waiting for its exit code; Ctrl+C still reaches node through the shared console. The release smoke check imports a schema named "smoke schema" and fails if it does not come back whole.
%LOCALAPPDATA%\Layang belongs to the desktop app's Squirrel installer, which empties it on every install, so installing or updating the desktop app deleted the CLI at %LOCALAPPDATA%\Layang\CLI. The CLI now installs to %LOCALAPPDATA%\Layang-CLI (or LAYANG_CLI_HOME). The installer removes a CLI left at the old location and its PATH entry, keeps the new directory first on PATH, and replaces app/ and runtime/ of a previous version instead of copying over them.
Ubuntu runners block unprivileged user namespaces, so Chromium uses the SUID sandbox helper and aborts unless it is owned by root with mode 4755.
Direct: electron 42.11.18, next 16.4.6, protobufjs 8.8.1, @grpc/grpc-js 1.14.7, @grpc/proto-loader 0.8.1, @electron-forge 7.11.2, postcss 8.5.33, wait-on 9.5.1, concurrently 9.2.5, tailwindcss 4.3.5. Transitive packages with a fixed release on their current line are pinned through pnpm overrides (undici, axios, tar, shell-quote, sharp, protobufjs 7, ...). protobufjs 8.8 uses TextDecoder when it loads, so the worker test's VM sandbox now provides the TextDecoder and TextEncoder a Web Worker has.
extract-zip (@electron/packager), picomatch (fast-glob in Forge) and image-size (appdmg, fixed only in an incompatible 2.x) run only when the desktop app is packaged and never ship in the app or the CLI.
…ices and main panels
The compact split layout suite had no tests left; only its unused helpers remained.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes for the 1.2.0 CLI, a readable workspace layout that the CLI and the desktop app share, and gRPC docs that read like an API reference.
CLI
protobufjs7 inside@grpc/proto-loader), so gateway commands no longer fail withCannot find module '@protobufjs/aspromise'.timeoutMsand transport mode;--timeoutand--transportstill override them.example:run --alltakes--collectionand matches--requestagainst the request an example is linked to.gateway:listlists profiles.CreateProcessWwith Windows quoting rules).%LOCALAPPDATA%\Layang-CLI. The desktop app's Squirrel installer empties%LOCALAPPDATA%\Layang, which deleted the CLI. Installing removes the pre-1.2 location and its PATH entry.Workspace
WORKSPACE_CHANGED_EXTERNALLY) and the workspace is reloaded from disk.<request>.examples/<name>.example.yml, with an optionalmock.scenario).Docs
docs/published/grpc/openapi.yaml: onePOST /<package.Service>/<Method>per RPC, with named examples, gRPC status responses andx-grpcextensions.docs:buildapplies the same documentation settings rules as the desktop app.Test plan
pnpm testpasses: 638 pass, 2 skipped, 0 fail. Typecheck is clean; lint shows only the warnings already onmain.pnpm run cli:distsmoke check passes, including a name with spaces through the native launcher.example:run --all --collection "FE Main Display"passes 9/9, andlayang uiopens the workspace without changing it.docs:buildoutput.🤖 Generated with Claude Code