Skip to content

Fix outdated NodeJS Extensions documentation - update package installation examples to use callback API#815

Merged
aaronpowell merged 2 commits into
mainfrom
copilot/fix-807
Aug 28, 2025
Merged

Fix outdated NodeJS Extensions documentation - update package installation examples to use callback API#815
aaronpowell merged 2 commits into
mainfrom
copilot/fix-807

Conversation

Copilot AI commented Aug 28, 2025

Copy link
Copy Markdown
Contributor

The documentation in the NodeJS Extensions README was showing outdated examples for passing additional arguments to package managers during installation. The examples were using the old array-based API that was changed to a callback-based API in PR #740.

Before (incorrect):

builder.AddNpmApp("npm-app", "./path/to/app")
    .WithNpmPackageInstallation(useCI: false, args: ["--legacy-peer-deps"])
    .WithExternalHttpEndpoints();

After (correct):

builder.AddNpmApp("npm-app", "./path/to/app")
    .WithNpmPackageInstallation(useCI: false, configureInstaller =>
    {
        configureInstaller.WithArgs("--legacy-peer-deps");
    })
    .WithExternalHttpEndpoints();

Updated all three package manager examples (npm, yarn, and pnpm) in the "Package installation with custom flags" section to use the current callback-based configuration API that matches the actual implementation and test examples.

Fixes #807.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dnceng.pkgs.visualstudio.com
    • Triggering command: dotnet build (dns block)
    • Triggering command: dotnet test --no-build --verbosity normal (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

…ation examples to use callback API instead of array API

Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
Copilot AI changed the title [WIP] Outdated doc, passing additional args to npm/yarn/Pnpm is no longer an array but an callback instead Fix outdated NodeJS Extensions documentation - update package installation examples to use callback API Aug 28, 2025
Copilot AI requested a review from aaronpowell August 28, 2025 00:57
@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Branch Rate Complexity Health
CommunityToolkit.Aspire.EventStore 100% 100% 46
CommunityToolkit.Aspire.GoFeatureFlag 100% 97% 74
CommunityToolkit.Aspire.Hosting.ActiveMQ 79% 40% 100
CommunityToolkit.Aspire.Hosting.ActiveMQ.MassTransit 1% 0% 14
CommunityToolkit.Aspire.Hosting.Adminer 73% 50% 20
CommunityToolkit.Aspire.Hosting.Azure.Dapr 66% 50% 832
CommunityToolkit.Aspire.Hosting.Azure.Dapr.Redis 97% 88% 36
CommunityToolkit.Aspire.Hosting.Azure.DataApiBuilder 100% 100% 22
CommunityToolkit.Aspire.Hosting.Bun 82% 71% 54
CommunityToolkit.Aspire.Hosting.Dapr 62% 51% 728
CommunityToolkit.Aspire.Hosting.DbGate 94% 50% 18
CommunityToolkit.Aspire.Hosting.Deno 84% 75% 72
CommunityToolkit.Aspire.Hosting.EventStore 94% 100% 18
CommunityToolkit.Aspire.Hosting.GoFeatureFlag 93% 50% 18
CommunityToolkit.Aspire.Hosting.Golang 87% 70% 28
CommunityToolkit.Aspire.Hosting.Java 69% 72% 120
CommunityToolkit.Aspire.Hosting.k6 58% 12% 20
CommunityToolkit.Aspire.Hosting.LavinMQ 78% 50% 18
CommunityToolkit.Aspire.Hosting.LavinMQ.MassTransit 1% 0% 14
CommunityToolkit.Aspire.Hosting.MailPit 91% 50% 14
CommunityToolkit.Aspire.Hosting.McpInspector 89% 54% 130
CommunityToolkit.Aspire.Hosting.Meilisearch 73% 57% 50
CommunityToolkit.Aspire.Hosting.Minio 93% 75% 48
CommunityToolkit.Aspire.Hosting.MongoDB.Extensions 96% 83% 36
CommunityToolkit.Aspire.Hosting.MySql.Extensions 100% 88% 78
CommunityToolkit.Aspire.Hosting.Ngrok 52% 35% 82
CommunityToolkit.Aspire.Hosting.NodeJS.Extensions 47% 52% 136
CommunityToolkit.Aspire.Hosting.Ollama 67% 70% 174
CommunityToolkit.Aspire.Hosting.PapercutSmtp 92% 50% 10
CommunityToolkit.Aspire.Hosting.PostgreSQL.Extensions 99% 89% 84
CommunityToolkit.Aspire.Hosting.Python.Extensions 68% 55% 90
CommunityToolkit.Aspire.Hosting.RavenDB 63% 49% 136
CommunityToolkit.Aspire.Hosting.Redis.Extensions 100% 71% 48
CommunityToolkit.Aspire.Hosting.Rust 94% 83% 16
CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects 76% 64% 154
CommunityToolkit.Aspire.Hosting.Sqlite 99% 89% 42
CommunityToolkit.Aspire.Hosting.SqlServer.Extensions 100% 87% 78
CommunityToolkit.Aspire.Hosting.SurrealDb 53% 35% 234
CommunityToolkit.Aspire.MassTransit.RabbitMQ 100% 100% 30
CommunityToolkit.Aspire.Meilisearch 97% 92% 68
CommunityToolkit.Aspire.Microsoft.Data.Sqlite 89% 85% 52
CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite 50% 50% 88
CommunityToolkit.Aspire.Minio.Client 73% 59% 88
CommunityToolkit.Aspire.OllamaSharp 74% 69% 120
CommunityToolkit.Aspire.RavenDB.Client 60% 53% 237
CommunityToolkit.Aspire.SurrealDb 79% 63% 78
Summary 71% (7372 / 10451) 59% (2269 / 3878) 4653

Minimum allowed line rate is 60%

Copilot AI temporarily deployed to azure-artifacts August 28, 2025 01:12 Inactive
@aaronpowell aaronpowell marked this pull request as ready for review August 28, 2025 01:54
Copilot AI review requested due to automatic review settings August 28, 2025 01:54
@aaronpowell aaronpowell merged commit c6e9368 into main Aug 28, 2025
99 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes outdated documentation examples in the NodeJS Extensions README by updating package installation code snippets to use the current callback-based API instead of the deprecated array-based API that was changed in PR #740.

  • Updates three package manager examples (npm, yarn, pnpm) to use callback-based configuration
  • Replaces old args: ["..."] syntax with new configureInstaller => { configureInstaller.WithArgs("..."); } pattern
  • Ensures documentation matches the actual implementation and test examples

@aaronpowell aaronpowell deleted the copilot/fix-807 branch August 28, 2025 01:54
axies20 added a commit to axies20/CommunityToolkit.Aspire that referenced this pull request Nov 30, 2025
- Introduced `CommunityToolkit.Aspire.Hosting.Logto` project for integrating Logto with PostgreSQL and Redis.
- Added extension methods for configuring Logto containers, health checks, and resource dependencies.
- Created test projects for validating Logto container configuration and health checks.
- Added example projects under `examples/logto` showcasing Logto integration with PostgreSQL and Redis.
- Updated solution file and package references to include the new Logto project.
aaronpowell added a commit that referenced this pull request Jun 17, 2026
* Add Logto with PostgreSQL and Redis integration (#815)

- Introduced `CommunityToolkit.Aspire.Hosting.Logto` project for integrating Logto with PostgreSQL and Redis.
- Added extension methods for configuring Logto containers, health checks, and resource dependencies.
- Created test projects for validating Logto container configuration and health checks.
- Added example projects under `examples/logto` showcasing Logto integration with PostgreSQL and Redis.
- Updated solution file and package references to include the new Logto project.

* Add Logto client hosting support (#817)

- Introduced `CommunityToolkit.Aspire.Hosting.Logto.Client` project for integrating Logto client configuration.
- Added `LogtoClientBuilder` for seamless setup of Logto client services in `IHostApplicationBuilder`.
- Implemented connection string helper for parsing Logto connection strings.
- Updated solution and centralized package references to include the new project.

* Add Logto Client API example project

- Introduced `CommunityToolkit.Aspire.Hosting.Logto.ClientApi` under `examples/logto` to demonstrate Logto client integration.
- Added project configuration files (`Program.cs`, `appsettings.json`, `launchSettings.json`) for application setup.
- Renamed `AddLogtoClient` to `AddLogtoSDKClient` in `LogtoClientBuilder`.
- Updated solution and centralized package references to include the new example project and dependencies.

* Add tests and enhancements for Logto Client integration

- Introduced a new test project `CommunityToolkit.Aspire.Hosting.Logto.Client.Tests` for validating Logto client behavior.
- Added integration and unit tests for `LogtoClientBuilder` and `LogtoConnectionStringHelper`.
- Implemented OIDC authentication and JWT bearer support in `LogtoClientBuilder`.
- Extended `Program.cs` in `ClientApi` example with authentication routes (`/me`, `/signin`, `/signout`).
- Updated dependencies and centralized package references for added functionalities.
- Modified project and solution files to include updated references.

* Refactor Logto client integration

- Updated method names from `AddLogtoSDKClient` to `AddLogtoOIDC` for better alignment with OIDC usage.
- Enhanced `AddLogtoOIDC` and `AddLogtoJwtBearer` methods to support additional configuration options.
- Added `Microsoft.Extensions.DependencyInjection.Abstractions` package reference to support service registration.
- Updated tests to reflect the method renaming and new configuration capabilities.
- Extended `Program.cs` in the ClientApi example to include `UseAuthentication` and `UseAuthorization`.
- Improved consistency and readability of XML documentation across updated methods.
- Centralized package references for additional dependencies in `Directory.Packages.props`.

* Remove unused `/signout` route from ClientApi example

* Rename `ClientApi` example to `ClientOIDC` and update method signatures

- Changed the `ClientApi` project to `ClientOIDC` for better alignment with OIDC standards.
- Updated method signatures in `LogtoClientBuilder` to use `appIndeficator` instead of `appId` and support multiple audience identifiers.
- Improved XML documentation consistency for updated methods.
- Adjusted solution, project references, and configuration files to reflect the renaming and API changes.

* Add `ClientJWT` example with Logto JWT authentication support

- Introduced `CommunityToolkit.Aspire.Hosting.Logto.ClientJWT` project under `examples/logto` to demonstrate Logto JWT authentication.
- Configured authentication and authorization middleware with Logto's JWT Bearer scheme in `Program.cs`.
- Added example routes (`/secure` and `/tokens`) for testing secured endpoint access and token retrieval.
- Updated `AppHost` to include `ClientJWT` project as a dependency.
- Improved XML documentation for `AddLogtoJwtBearer` methods, including updated parameter descriptions and exception handling.

* Update examples/logto/CommunityToolkit.Aspire.Hosting.Logto.AppHost/CommunityToolkit.Aspire.Hosting.Logto.AppHost.csproj

Co-authored-by: Aaron Powell <me@aaron-powell.com>

* Update src/CommunityToolkit.Aspire.Hosting.Logto.Client/CommunityToolkit.Aspire.Hosting.Logto.Client.csproj

Co-authored-by: Aaron Powell <me@aaron-powell.com>

* Remove unused package references and resolve merge conflict in project and package configuration files

* Update package versions and project SDKs for Logto client integration

- Upgraded `Aspire.AppHost.Sdk` from `13.0.0` to `13.2.0` in `examples/logto/CommunityToolkit.Aspire.Hosting.Logto.AppHost.csproj`.
- Added `Microsoft.AspNetCore.Authentication.JwtBearer` and `Microsoft.AspNetCore.Authentication.OpenIdConnect` package versions to `Directory.Packages.props`.

* Update `ClientJWT` example to use a constant for API audience in Logto JWT configuration

- Replaced hardcoded API audience with a `const` string in `Program.cs` for improved readability and maintainability.

* Remove `<IsPreview>` property from Logto project

* Rename `Hosting.Logto.Client` to `Logto.Client` and adjust related references

- Renamed `CommunityToolkit.Aspire.Hosting.Logto.Client` to `CommunityToolkit.Aspire.Logto.Client` for improved namespace consistency.
- Updated all project, namespace, and solution references to reflect the renaming.
- Adjusted example projects (`ClientJWT` and `ClientOIDC`) and `AppHost` references accordingly.

* Add `WithDeprecationTracing` method to enable Node.js deprecation tracing in Logto container

* Add `Hosting.Logto.Tests` and `Logto.Client.Tests` to test matrix in GitHub Actions

* Refactor Logto configuration: introduce validation for Logto options and add support for data volume mapping.

* Refactor `AppHostTest` to use `AspireIntegrationTestFixture`; add `AppHost` project reference to test project

* Allow null `port` and `adminPort` in `WithResourcePort` to enable random host port assignment.

* Update Logto container tag to v1.38

* Refactor `LogtoContainerResource` to `LogtoResource` and update related APIs and tests. Streamline naming for consistency.

* Set default HTTP and admin ports in `WithResourcePort` method of `LogtoBuilderExtensions`.

* Update examples/logto/CommunityToolkit.Aspire.Hosting.Logto.AppHost/CommunityToolkit.Aspire.Hosting.Logto.AppHost.csproj

* Add Logto integration: introduce `LogtoResource` and client builders with OIDC and JWT Bearer configurations. Update APIs, examples, and tests.

* Apply suggestion from @aaronpowell

* Fixing build errors

* Fix Logto test startup

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* not using persisted db

This seems to be messing with local dev auth from postgres.

* Testing a better endpoint

* deleting the generated files

* Adding missing README.md

---------

Co-authored-by: Aaron Powell <me@aaron-powell.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Outdated doc, passing additional args to npm/yarn/Pnpm is no longer an array but an callback instead

3 participants