Rename Aspire.Hosting.NodeJs to Aspire.Hosting.JavaScript#12681
Rename Aspire.Hosting.NodeJs to Aspire.Hosting.JavaScript#12681eerhardt merged 3 commits intodotnet:mainfrom
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12681Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12681" |
There was a problem hiding this comment.
Pull Request Overview
This PR renames the Aspire.Hosting.NodeJs package to Aspire.Hosting.JavaScript to better reflect its broader support for JavaScript applications beyond just Node.js. The refactoring includes removing obsolete APIs (AddNpmApp and an older AddNodeApp overload), updating namespaces from Aspire.Hosting.NodeJs to Aspire.Hosting.JavaScript, and renaming the main extension class from NodeAppHostingExtension to JavaScriptHostingExtensions.
Key changes:
- Namespace migration from
Aspire.Hosting.NodeJstoAspire.Hosting.JavaScript - Removal of obsolete
AddNpmAppmethod in favor ofAddJavaScriptApp - Removal of unused imports and overload resolution priority attributes
- Updates to all project references, test code, and documentation
Reviewed Changes
Copilot reviewed 32 out of 33 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Aspire.Playground.Tests/Infrastructure/DistributedApplicationExtensions.cs | Updates using statement to reference Aspire.Hosting.JavaScript |
| tests/Aspire.Playground.Tests/Aspire.Playground.Tests.csproj | Changes package reference from NodeJs to JavaScript |
| tests/Aspire.Hosting.Tests/PublishAsDockerfileTests.cs | Replaces AddNpmApp calls with AddJavaScriptApp |
| tests/Aspire.Hosting.Tests/Aspire.Hosting.Tests.csproj | Updates project reference to JavaScript package |
| tests/Aspire.Hosting.JavaScript.Tests/*.cs | Updates all test file namespaces to use JavaScript instead of NodeJs |
| tests/Aspire.Hosting.JavaScript.Tests/NodeJsPublicApiTests.cs | Replaces obsolete AddNpmApp tests with AddJavaScriptApp tests |
| tests/Aspire.Hosting.JavaScript.Tests/NodeAppFixture.cs | Updates to use AddJavaScriptApp and changes return type for NpmAppBuilder |
| tests/Aspire.Hosting.JavaScript.Tests/AddNodeAppTests.cs | Updates test assertions for new default script name |
| src/Aspire.Hosting.NodeJs/api/Aspire.Hosting.NodeJs.cs | Removes obsolete API surface file |
| src/Aspire.Hosting.JavaScript/*.cs | Updates all source file namespaces from NodeJs to JavaScript |
| src/Aspire.Hosting.JavaScript/JavaScriptHostingExtensions.cs | Removes obsolete methods, unused imports, and renames class |
| src/Aspire.Hosting.JavaScript/Aspire.Hosting.JavaScript.csproj | Updates description and disables package validation |
| src/Aspire.Hosting.JavaScript/README.md | Updates package name and documentation |
| playground/AspireWithNode/AspireWithNode.AppHost/*.csproj | Updates to reference JavaScript package |
| playground/AspireWithJavaScript/AspireJavaScript.AppHost/*.csproj | Updates to reference JavaScript package |
| *.slnx | Updates solution files to reference JavaScript project paths |
| src/Aspire.ProjectTemplates/templates/aspire-py-starter/13.0/apphost.cs | Updates template to reference JavaScript package |
| tests/Aspire.Cli.Tests/Projects/FallbackProjectParserTests.cs | Adds missing closing brace |
Comments suppressed due to low confidence (3)
src/Aspire.Hosting.JavaScript/README.md:17
- The text contains a grammatical error. 'add a Or resource' should be 'add a JavaScript resource' or similar descriptive text. This appears to be leftover template text.
src/Aspire.Hosting.JavaScript/README.md:22 - The example code is incorrect. According to the API,
AddJavaScriptApprequires arunScriptNameparameter (not a script path like 'app.js'). Based on the test in AddNodeAppTests.cs line 64, the correct default should be 'dev'. The example should either useAddNodeAppfor running a script file, or useAddJavaScriptAppwith a script name like 'start' or 'dev'.
tests/Aspire.Hosting.JavaScript.Tests/NodeAppFixture.cs:36 - The script name parameter passed to
AddJavaScriptAppis 'start', but based on the changes in AddNodeAppTests.cs at line 64, the default script name for the generated manifest should be 'dev'. This inconsistency could cause test failures or unexpected behavior.
This makes the library consistent to use language naming, and not a single technology. It allows for more JS features in the future that aren't tied to Node.js. Since the library is being renamed, I also removed the Obsolete APIs since there is no reason to ship them in the new library. Contributes to dotnet#12058
707aa76 to
7a91988
Compare
|
/backport to release/13.0 |
|
Started backporting to release/13.0: https://github.com/dotnet/aspire/actions/runs/19087109876 |
|
@eerhardt backporting to "release/13.0" failed, the patch most likely resulted in conflicts: $ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: Rename Aspire.Hosting.NodeJs to Aspire.Hosting.JavaScript
Using index info to reconstruct a base tree...
M src/Aspire.Hosting.NodeJs/JavaScriptAppResource.cs
M src/Aspire.Hosting.NodeJs/NodeAppResource.cs
Falling back to patching base and 3-way merge...
Auto-merging src/Aspire.Hosting.JavaScript/JavaScriptAppResource.cs
CONFLICT (content): Merge conflict in src/Aspire.Hosting.JavaScript/JavaScriptAppResource.cs
Auto-merging src/Aspire.Hosting.JavaScript/NodeAppResource.cs
CONFLICT (content): Merge conflict in src/Aspire.Hosting.JavaScript/NodeAppResource.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Rename Aspire.Hosting.NodeJs to Aspire.Hosting.JavaScript
Error: The process '/usr/bin/git' failed with exit code 128Please backport manually! |
* Rename Aspire.Hosting.NodeJs to Aspire.Hosting.JavaScript This makes the library consistent to use language naming, and not a single technology. It allows for more JS features in the future that aren't tied to Node.js. Since the library is being renamed, I also removed the Obsolete APIs since there is no reason to ship them in the new library. Contributes to dotnet#12058 * Fix build * Fix Helix tests
…12687) * Rename Aspire.Hosting.NodeJs to Aspire.Hosting.JavaScript This makes the library consistent to use language naming, and not a single technology. It allows for more JS features in the future that aren't tied to Node.js. Since the library is being renamed, I also removed the Obsolete APIs since there is no reason to ship them in the new library. Contributes to #12058 * Fix build * Fix Helix tests
Description
This makes the library consistent to use language naming, and not a single technology. It allows for more JS features in the future that aren't tied to Node.js.
Since the library is being renamed, I also removed the Obsolete APIs since there is no reason to ship them in the new library.
Contributes to #12058
Checklist