Skip to content

Add JS dependency update instructions to chat template README #6376

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
May 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ Make sure to replace `YOUR-AZURE-AI-SEARCH-KEY` and `YOUR-AZURE-AI-SEARCH-ENDPOI
3. Once installed, Open the `Program.cs` file.
4. Run the project by clicking the "Run" button in the Debug view.

# Updating JavaScript dependencies

This template leverages JavaScript libraries to provide essential functionality. These libraries are located in the wwwroot/lib folder. For instructions on updating each dependency, please refer to the README.md file in each respective folder.

# Learn More
To learn more about development with .NET and AI, check out the following links:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ dompurify version 3.2.4
https://github.com/cure53/DOMPurify
License: Apache 2.0 and Mozilla Public License 2.0

To update, replace the files with an updated build from https://www.npmjs.com/package/dompurify
To update, replace the `dist/purify.es.mjs` file with an updated version from https://www.npmjs.com/package/dompurify.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ marked version 15.0.6
https://github.com/markedjs/marked
License: MIT

To update, replace the files with with an updated build from https://www.npmjs.com/package/marked
To update, replace the `dist/marked.esm.js` file with with an updated version from https://www.npmjs.com/package/marked.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@ pdfjs-dist version 4.10.38
https://github.com/mozilla/pdf.js
License: Apache-2.0

To update, replace the files with an updated build from https://www.npmjs.com/package/pdfjs-dist
To update, replace the following files with updated versions from https://www.npmjs.com/package/pdfjs-dist:
* `build/pdf.min.mjs`
* `build/pdf.worker.min.mjs`
* `web/pdf_viewer.css`
* `web/pdf_viewer.mjs`
* `web/images/loading-icon.gif`
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ Several .NET Aspire templates include ASP.NET Core projects that are configured

See [Troubleshoot untrusted localhost certificate in .NET Aspire](https://learn.microsoft.com/dotnet/aspire/troubleshooting/untrusted-localhost-certificate) for more information.

# Updating JavaScript dependencies

This template leverages JavaScript libraries to provide essential functionality. These libraries are located in the wwwroot/lib folder of the ChatWithCustomData-CSharp.Web project. For instructions on updating each dependency, please refer to the README.md file in each respective folder.

# Learn More
To learn more about development with .NET and AI, check out the following links:

Expand Down
10 changes: 10 additions & 0 deletions src/ProjectTemplates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ To update project template JavaScript dependencies:

To add a new dependency, run `npm install <package-name>` and update the `scripts` section in `package.json` to specify how the new dependency should be copied into its template.

# Component governance

There are two types of template dependencies that need to get scanned for component governance (CG):
* .NET dependencies (specified via `<PackageReference />` in each `.csproj` file)
* JS dependencies (everything in the `wwwroot/lib` folder of the `.Web` project)

There are template execution tests in the `test/ProjectTemplates` folder of this repo that create, restore, and build each possible variation of the template. These tests execute before the CG step of the internal CI pipeline, which scans the build artifacts from each generated project (namely the `project.assets.json` file and the local NuGet package cache) to detect which .NET dependencies got pulled in.

However, CG can't detect JS dependencies by scanning execution test output, because the generated projects don't contain manifests describing JS dependencies. Instead, we have a `package.json` and `package-lock.json` in the same folder as this README that define which JS dependencies get included in the template and how they get copied into template content (see previous section in this document). CG then automatically tracks packages listed in this `package-lock.json`.

# Running AI templates

## Build the templates using just-built library package versions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
https://github.com/cure53/DOMPurify
License: Apache 2.0 and Mozilla Public License 2.0

To update, replace the files with an updated build from https://www.npmjs.com/package/dompurify
To update, replace the `dist/purify.es.mjs` file with an updated version from https://www.npmjs.com/package/dompurify.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
https://github.com/markedjs/marked
License: MIT

To update, replace the files with with an updated build from https://www.npmjs.com/package/marked
To update, replace the `dist/marked.esm.js` file with with an updated version from https://www.npmjs.com/package/marked.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@
https://github.com/mozilla/pdf.js
License: Apache-2.0

To update, replace the files with an updated build from https://www.npmjs.com/package/pdfjs-dist
To update, replace the following files with updated versions from https://www.npmjs.com/package/pdfjs-dist:
* `build/pdf.min.mjs`
* `build/pdf.worker.min.mjs`
* `web/pdf_viewer.css`
* `web/pdf_viewer.mjs`
* `web/images/loading-icon.gif`
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ Several .NET Aspire templates include ASP.NET Core projects that are configured

See [Troubleshoot untrusted localhost certificate in .NET Aspire](https://learn.microsoft.com/dotnet/aspire/troubleshooting/untrusted-localhost-certificate) for more information.

# Updating JavaScript dependencies

This template leverages JavaScript libraries to provide essential functionality. These libraries are located in the wwwroot/lib folder of the aichatweb.Web project. For instructions on updating each dependency, please refer to the README.md file in each respective folder.

# Learn More
To learn more about development with .NET and AI, check out the following links:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
https://github.com/cure53/DOMPurify
License: Apache 2.0 and Mozilla Public License 2.0

To update, replace the files with an updated build from https://www.npmjs.com/package/dompurify
To update, replace the `dist/purify.es.mjs` file with an updated version from https://www.npmjs.com/package/dompurify.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
https://github.com/markedjs/marked
License: MIT

To update, replace the files with with an updated build from https://www.npmjs.com/package/marked
To update, replace the `dist/marked.esm.js` file with with an updated version from https://www.npmjs.com/package/marked.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@
https://github.com/mozilla/pdf.js
License: Apache-2.0

To update, replace the files with an updated build from https://www.npmjs.com/package/pdfjs-dist
To update, replace the following files with updated versions from https://www.npmjs.com/package/pdfjs-dist:
* `build/pdf.min.mjs`
* `build/pdf.worker.min.mjs`
* `web/pdf_viewer.css`
* `web/pdf_viewer.mjs`
* `web/images/loading-icon.gif`
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ Make sure to replace `YOUR-AZURE-AI-SEARCH-ENDPOINT` with your actual Azure AI S
3. Once installed, Open the `Program.cs` file.
4. Run the project by clicking the "Run" button in the Debug view.

# Updating JavaScript dependencies

This template leverages JavaScript libraries to provide essential functionality. These libraries are located in the wwwroot/lib folder. For instructions on updating each dependency, please refer to the README.md file in each respective folder.

# Learn More
To learn more about development with .NET and AI, check out the following links:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
https://github.com/cure53/DOMPurify
License: Apache 2.0 and Mozilla Public License 2.0

To update, replace the files with an updated build from https://www.npmjs.com/package/dompurify
To update, replace the `dist/purify.es.mjs` file with an updated version from https://www.npmjs.com/package/dompurify.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
https://github.com/markedjs/marked
License: MIT

To update, replace the files with with an updated build from https://www.npmjs.com/package/marked
To update, replace the `dist/marked.esm.js` file with with an updated version from https://www.npmjs.com/package/marked.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@
https://github.com/mozilla/pdf.js
License: Apache-2.0

To update, replace the files with an updated build from https://www.npmjs.com/package/pdfjs-dist
To update, replace the following files with updated versions from https://www.npmjs.com/package/pdfjs-dist:
* `build/pdf.min.mjs`
* `build/pdf.worker.min.mjs`
* `web/pdf_viewer.css`
* `web/pdf_viewer.mjs`
* `web/images/loading-icon.gif`
Loading