From 07a51872d5b2dcd2db4bb970ffb8469b31de0596 Mon Sep 17 00:00:00 2001 From: Alan Agius <17563226+alan-agius4@users.noreply.github.com> Date: Fri, 24 Oct 2025 18:45:32 +0200 Subject: [PATCH] build: refactor location of best-practices.md This commit moves the best-practices.md file from adev/src/context to packages/core/resources. The BUILD.bazel files and other configuration files have been updated to reflect this change. --- .ng-dev/google-sync-config.json | 2 +- adev/src/assets/BUILD.bazel | 1 + adev/src/content/ai/BUILD.bazel | 1 + adev/src/content/ai/develop-with-ai.md | 6 +++--- packages/core/BUILD.bazel | 1 + packages/core/package.json | 6 ++++++ packages/core/resources/BUILD.bazel | 15 +++++++++++++++ .../core/resources}/best-practices.md | 0 8 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 packages/core/resources/BUILD.bazel rename {adev/src/context => packages/core/resources}/best-practices.md (100%) diff --git a/.ng-dev/google-sync-config.json b/.ng-dev/google-sync-config.json index 89d77442a04..d120322c8b0 100644 --- a/.ng-dev/google-sync-config.json +++ b/.ng-dev/google-sync-config.json @@ -3,7 +3,7 @@ "separateFilePatterns": ["packages/core/primitives/**"], "alwaysExternalFilePatterns": [ "packages/*", - "packages/bazel/**", + "packages/core/resources/**", "packages/compiler-cli/linker/**", "packages/compiler-cli/src/ngtsc/sourcemaps/**", "packages/compiler-cli/src/ngtsc/testing/**", diff --git a/adev/src/assets/BUILD.bazel b/adev/src/assets/BUILD.bazel index 1b82b4a5af4..e6ea77ced69 100644 --- a/adev/src/assets/BUILD.bazel +++ b/adev/src/assets/BUILD.bazel @@ -133,6 +133,7 @@ copy_to_directory( name = "context", srcs = [ "//adev/src/context", + "//packages/core/resources:best-practices.md", ], replace_prefixes = { "**/": "", diff --git a/adev/src/content/ai/BUILD.bazel b/adev/src/content/ai/BUILD.bazel index 3c1ce7ede22..0ed43c77fbe 100644 --- a/adev/src/content/ai/BUILD.bazel +++ b/adev/src/content/ai/BUILD.bazel @@ -9,6 +9,7 @@ generate_guides( data = [ "//adev/src/assets/images:what_is_angular.svg", "//adev/src/context", + "//packages/core/resources:best-practices.md", ], visibility = ["//adev:__subpackages__"], ) diff --git a/adev/src/content/ai/develop-with-ai.md b/adev/src/content/ai/develop-with-ai.md index fa7e25216a0..6ea5296af27 100644 --- a/adev/src/content/ai/develop-with-ai.md +++ b/adev/src/content/ai/develop-with-ai.md @@ -10,9 +10,9 @@ NOTE: These files will be updated on a regular basis staying up to date with Ang Here is a set of instructions to help LLMs generate correct code that follows Angular best practices. This file can be included as system instructions to your AI tooling or included along with your prompt as context. - + -Click here to download the best-practices.md file. +Click here to download the best-practices.md file. ## Rules Files Several editors, such as Firebase Studio have rules files useful for providing critical context to LLMs. @@ -35,7 +35,7 @@ The Angular CLI includes an experimental [Model Context Protocol (MCP) server](h `llms.txt` is a proposed standard for websites designed to help LLMs better understand and process their content. The Angular team has developed two versions of this file to help LLMs and tools that use LLMs for code generation to create better modern Angular code. -* llms.txt - an index file providing links to key files and resources. +* llms.txt - an index file providing links to key files and resources. * llms-full.txt - a more robust compiled set of resources describing how Angular works and how to build Angular applications. Be sure [to check out the overview page](/ai) for more information on how to integrate AI into your Angular applications. diff --git a/packages/core/BUILD.bazel b/packages/core/BUILD.bazel index 8a3049419b5..cbae25a6d81 100644 --- a/packages/core/BUILD.bazel +++ b/packages/core/BUILD.bazel @@ -58,6 +58,7 @@ ng_package( srcs = [ "package.json", ":event_dispatch_contract_binary", + "//packages/core/resources", ], nested_packages = [ "//packages/core/schematics:npm_package", diff --git a/packages/core/package.json b/packages/core/package.json index da833ff95b9..c23d43b6a95 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -40,6 +40,12 @@ "migrations": "./schematics/migrations.json", "packageGroup": "NG_UPDATE_PACKAGE_GROUP" }, + "angular": { + "bestPractices": { + "format": "markdown", + "path": "./resources/best-practices.md" + } + }, "schematics": "./schematics/collection.json", "sideEffects": false } diff --git a/packages/core/resources/BUILD.bazel b/packages/core/resources/BUILD.bazel new file mode 100644 index 00000000000..4fabaefae64 --- /dev/null +++ b/packages/core/resources/BUILD.bazel @@ -0,0 +1,15 @@ +exports_files( + srcs = ["best-practices.md"], + visibility = [ + "//adev/src/assets:__pkg__", + "//adev/src/content/ai:__pkg__", + ], +) + +filegroup( + name = "resources", + srcs = ["best-practices.md"], + visibility = [ + "//packages/core:__pkg__", + ], +) diff --git a/adev/src/context/best-practices.md b/packages/core/resources/best-practices.md similarity index 100% rename from adev/src/context/best-practices.md rename to packages/core/resources/best-practices.md