feat(snippets): add sdk-docs install canonicals for 9 SDKs#439
Open
kinyoklion wants to merge 1 commit into
Open
feat(snippets): add sdk-docs install canonicals for 9 SDKs#439kinyoklion wants to merge 1 commit into
kinyoklion wants to merge 1 commit into
Conversation
This was referenced May 8, 2026
9f34243 to
28d356a
Compare
Adds 12 canonical .snippet.md files under
snippets/sdks/<sdk>/snippets/sdk-docs/ for the install/manifest
CodeBlocks in ld-docs's top-level reference pages
(`fern/topics/sdk/{server-side,client-side}/<sdk>/index.mdx`) that
the original auto-port (sdk-meta PR #414) skipped per the
shell/bash/cmd skip rule (SDK-2300).
These snippets unblock ld-docs-private PR #7592, which can insert
markers pointing at them in a follow-up commit once this lands and
a new `snippets/v*` is cut.
Per-SDK file count:
| SDK | snippet IDs |
|---|---|
| dotnet-server-sdk | install-the-sdk-shell |
| java-server-sdk | install-the-sdk-gradle |
| node-server-sdk | install-the-sdk-shell |
| php-server-sdk | install-the-sdk-shell |
| ruby-server-sdk | install-the-sdk-shell |
| rust-server-sdk | install-the-sdk-shell |
| node-client-sdk | install-the-sdk-installing-with-npm, install-the-sdk-installing-with-yarn |
| react-native-client-sdk | install-the-sdk-installing-react-native-sdk-v10, install-the-sdk-adding-the-async-storage-dependency |
| vue-client-sdk | install-the-sdk-installing-with-npm, install-the-sdk-installing-with-yarn |
`go-server-sdk` is intentionally not in the list: the "Shell install"
mention in PR #7592's per-SDK table refers to a prose backtick quote
of `go get …`, not an MDX CodeBlock — there's nothing to canonicalize.
Bodies are byte-verbatim copies of what's in ld-docs today; verified
by running `snippets render --target=ld-docs` after a synthetic
marker insertion and confirming a zero-body-diff.
No `validation:` block: these are install/manifest fragments, not
runnable units. Adding shell-install or build-system-harness
validation for them is a separate workstream (PR #428's territory).
Replaces the originally-opened-as-9-separate-PRs sequence
(#430-#438) with a single PR per the user's
intent.
28d356a to
ec8d6b6
Compare
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
Stacked on #428, which lands the
shell-installvalidator infrastructure (withgemsupport and the multi-linelast_pkgextractor). Adds 12 canonical.snippet.mdfiles for the install / manifest<CodeBlock>regions in ld-docs's top-level reference pages that the original auto-port (#414) skipped per SDK-2300. All 12 get end-to-end shell-install validation against the real package registry.Unblocks the corresponding marker insertions on ld-docs-private #7592.
Per-SDK file list + validation status
node-server-sdkinstall-the-sdk-shellnode-client-sdkinstall-the-sdk-installing-with-npm,…with-yarnreact-native-client-sdkinstall-the-sdk-installing-react-native-sdk-v10,…adding-the-async-storage-dependencyruby-server-sdkinstall-the-sdk-shellvue-client-sdkinstall-the-sdk-installing-with-npm,…with-yarndotnet-server-sdkinstall-the-sdk-shellInstall-Packagelegacy line stripped)java-server-sdkinstall-the-sdk-gradlephp-server-sdkinstall-the-sdk-shellrust-server-sdkinstall-the-sdk-shellgo-server-sdkis intentionally not included — the "Shell install" mention in PR #7592's per-SDK table refers to a prose backtick quote ofgo get …, not an MDX CodeBlock.Validator extensions (Dockerfile + harness)
The shell-install image grew from a node + python + go + ruby base to also include rust toolchain, php + composer, .NET SDK 8, and OpenJDK 17 + Gradle 8.10. Image is now ~2 GB — a CI-only artifact, cached per matrix cell, so the size pays for itself after the first build.
New harness LEAD cases:
cargo—cargo initin a clean dir, run body, grepCargo.tomlfor the package name.php— symlinks/opt/composer.pharinto the working dir so the body's literalphp composer.phar require …resolves;composer init; run body; checkvendor/<pkg>/.dotnet—dotnet new console -n InstallSanity, cd in, run body, grep<PackageReference Include="…">from the generated csproj.Install-Packagestrip — multi-line bodies that show the legacy NuGet PowerShellInstall-Packageform alongside the moderndotnet add packageCLI form (for backward-compat documentation) get the legacy line stripped before LEAD detection. The dotnet CLI line is then validated via the case above.implementation(Gradle DSL fragment) — synthesizes a minimalbuild.gradle(plugins { id 'java' },mavenCentral(), the body inserted independencies { … }); runsgradle dependencies; greps the dependency-tree output for the artifact name extracted from the body'sname: '…'field.Bug found + fixed inline
shell-install'slast_pkgextractor was picking up trailing inline# commenttext as a package name. Multi-line bodies like vue'snpm install --save launchdarkly-vue-client-sdk\nnpm install @launchdarkly/observability # optional observability plugin\nnpm install @launchdarkly/session-replay # optional session replay pluginextractedpluginas the last package and then failedassert_node_moduleslooking fornode_modules/plugin/. Fixed by stripping inline shell comments before field-splitting in awk. Benefits any sdk-info or observability install body with comments too.Body fidelity
Each
.snippet.mdbody is a byte-verbatim copy of what's in ld-docs today. Verified by runningsnippets render --target=ld-docsafter a synthetic marker insertion and confirming the diff is exactly the marker comment — zero body bytes change.Test plan
go test ./...(fromsnippets/) passes.last_pkgis a strict improvement.Note
Medium Risk
Moderate risk because it expands the
shell-installvalidator’s Docker image/toolchain and adds new command-parsing/execution paths (cargo/composer/dotnet/gradle), which could impact CI reliability and install-snippet validation behavior.Overview
Adds canonical
sdk-docs“Install the SDK” snippet files for 9 SDKs (Node server/client, React Native, Vue, Ruby, Rust, PHP, .NET, Java) and binds them to theshell-installvalidator.Expands the
shell-installvalidator image and harness to validate additional install styles: installs Rust/cargo, PHP+Composer, .NET SDK, and JDK+Gradle; adds harness strategies forcargo add,php composer.phar require,dotnet add package, and Gradleimplementation ...fragments; strips legacy NuGetInstall-Packagelines; and fixes package-name extraction to ignore inline#comments in multi-line bodies.Reviewed by Cursor Bugbot for commit ec8d6b6. Bugbot is set up for automated code reviews on this repo. Configure here.