forked from angular/angular-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Create a new pull request by comparing changes across two branches #1142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
…ns types Exposes `CompilerPluginOptions` and `BundleStylesheetOptions` via the private API. These types are required for consumers of the `createCompilerPlugin` function to strictly type their configuration.
Replaces the Protractor-based `ng e2e` execution with the new Puppeteer `executeBrowserTest` utility in the express-engine E2E test suite.
This commit updates the package manager descriptor for modern Yarn (Berry) to align with its current CLI options and configuration mechanisms: - Removes `noLockfileFlag` as Yarn Berry does not support a direct `--no-lockfile` flag for adding packages. - Updates `ignoreScriptsFlag` to use `--mode=skip-build`, which is the modern equivalent for skipping build scripts during installation. - Changes `getRegistryOptions` to use `YARN_NPM_REGISTRY_SERVER` environment variable, which is the correct way to configure the registry in Yarn Berry.
This commit updates `parseNpmLikeManifest` to correctly handle the output of `npm view` (and compatible commands) when a version range is specified. In such cases, `npm view --json` returns an array of manifests. The parser now returns the last element of the array, which corresponds to the latest version satisfying the range, preventing issues in `ng update` and other commands that rely on version checks.
…indows compatibility Ensures that project and workspace root paths are converted to POSIX format before being used to determine relative test file paths. This fixes an issue on Windows where mixed path separators (backslashes in roots, forward slashes in file paths) caused test discovery to fail to correctly generate entry point names.
…ng non-C drives Ensures that test files requested via root-relative paths (common on Windows with non-C drives or specific Vitest configurations) are correctly resolved to their absolute path entry points. This fix prevents 'Cannot find module' errors by explicitly checking the test entry point map after normalizing the path to an absolute POSIX path.
Aligns the inline welcome message with the external template for consistency.
See associated pull request for more information.
…manager This commit adds support for ignoring peer dependency warnings and errors during package installation. This is useful for commands like `ng update` where transient peer dependency conflicts may occur. - Added `ignorePeerDependenciesFlag` to the `PackageManagerDescriptor` interface. - Implemented the flag for `npm` (`--force`) and `pnpm` (`--strict-peer-dependencies=false`). - Updated `PackageManager.install` to accept and apply the `ignorePeerDependencies` option.
…ommand This commit updates the `ng update` command to utilize the `ignorePeerDependencies` abstraction option when installing packages. Previously, the command forced the installation (`--force`) when NPM 7+ was detected to workaround peer dependency issues. Now, it uses the more specific `ignorePeerDependencies` option (mapping to `--force` for NPM).
This adds new tools for running unit and end-to-end tests via the MCP server.
…for default projects
See associated pull request for more information.
See associated pull request for more information.
See associated pull request for more information.
Replaces the Protractor-based `ng e2e` execution with the new Puppeteer `executeBrowserTest` utility in various build and misc E2E tests. The following tests were updated: - auto-csp - worker - trusted-types This migration involves implementing custom `checkFn` logic to replicate the assertions previously handled by Protractor, such as verifying server-rendered content, console logs, and service worker states.
See associated pull request for more information.
…ncIterable Refactor the Karma builder's `execute` function to return an `AsyncIterable` using a `ReadableStream`. This removes the RxJS dependency and aligns the builder with modern Angular CLI implementation patterns. Additionally, this change fixes a race condition where the Karma server could start even if the builder was cancelled during asynchronous initialization. An `isCancelled` flag is now used to ensure execution stops if a cancellation occurs before the server starts.
…webpack plugin callbacks Decouples the Karma builder from the Webpack plugin by removing the custom `successCb` and `failureCb` callback mechanism. The builder now idiomaticallly listens to the standard Karma `run_complete` event on the server instance to emit builder results.
…to AsyncIterable Refactor the Karma builder's main `execute` function to return an `AsyncIterable` instead of an RxJS `Observable`. This continues the effort to reduce RxJS usage in the CLI builders and aligns the implementation with modern Angular CLI patterns.
… builder Refactor the Karma builder's `execute` function to directly handle dynamic imports within conditional blocks. This eliminates the need for `getExecuteWithBuilder` and the resulting union types that required `as any` casting. This improves type safety by allowing TypeScript to verify the arguments passed to the specific builder implementations (Esbuild vs Webpack).
… API for karma builder Adds an `executeKarmaBuilder` wrapper function in the package entry point that returns an RxJS `Observable`. This maintains backward compatibility for the experimental public API while the internal implementation has been migrated to use `AsyncIterable`.
…on to karma builder Moves the instantiation of the Webpack Compiler from the Karma plugin to the Karma builder (`browser_builder`). This allows the builder to have full ownership of the compiler's lifecycle and configuration, including `singleRun` adjustments and output paths. The Karma plugin now receives the `compiler` instance directly instead of the configuration, reducing its responsibility to just integration logic.
…rom karma plugin Removes the `createConsoleLogger` import and its usage as a fallback in the Karma plugin. The logger is now consistently provided by the builder via the `buildWebpack` configuration object.
Consolidates the compiler hooks in the Karma plugin. Merges separate `compiler.hooks.done` taps into a single unified handler that manages error reporting, file refreshing, and blocking logic.
…ter from karma plugin Removes the `@angular-devkit/build-angular--event-reporter` and its logic. The reporter was no longer performing significant work after the removal of custom callbacks, and its primary remaining function was a logging hack that is no longer required.
…nup karma middleware Updates the `requestBlocker` and `fallbackMiddleware` functions in the Karma plugin to use strict `IncomingMessage`, `ServerResponse`, and `NextFunction` types from `node:http`. Also properly types the `webpackMiddleware` variable and ensures its `close` method is called with a callback in the exit handler, resolving a TypeScript error exposed by the stricter typing.
…cker from karma plugin Removes the custom request blocker middleware and related hooks from the Karma plugin. `webpack-dev-middleware` already handles blocking requests until compilation is valid, making this custom logic redundant and unnecessary.
…check in Karma plugin The Promise resolve function is idempotent. Removing the explicit 'isFirstRun' check simplifies the code as subsequent calls to resolve() after the first compilation will be ignored by the Promise.
See associated pull request for more information.
This change enables the `unit-test` builder to correctly extract base build options from `@angular/build:ng-packagr` targets. It parses the `ng-package.json` file to retrieve configuration for `assets`, `inlineStyleLanguage`, and `stylePreprocessorOptions`, ensuring that libraries can be unit-tested effectively.
…Exclude` list in `pnpm-workspace.yaml` This is no longer needed.
See associated pull request for more information.
See associated pull request for more information.
See associated pull request for more information.
See associated pull request for more information.
…iders This commit adds a new internal schematic `vitest-browser` to `@schematics/angular` which streamlines the setup of Vitest browser testing by handling `ng add` for the following packages: - `@vitest/browser-playwright` - `@vitest/browser-webdriverio` - `@vitest/browser-preview` The schematic performs the following actions: - Verifies the project is using the `@angular/build:unit-test` builder. - Updates `tsconfig.spec.json` to include `vitest/globals` and the respective browser provider package in `compilerOptions.types`. - Installs the requested package along with necessary peer dependencies (e.g., `playwright` or `webdriverio`). Additionally, the `ng add` command implementation in the CLI has been updated to support passing the package name to built-in schematics, allowing the `vitest-browser` schematic to know which package was requested.
… manager abstraction This change introduces the ability to specify a base temporary directory when creating a `PackageManager` instance. This allows for creating temporary directories within the project structure (e.g., `node_modules/.tmp`), which enables package managers to correctly inherit project-specific configurations like `.npmrc` or `.yarnrc` during operations like `acquireTempPackage`.
The 'ng add' command now attempts to use '.angular/cache' or 'node_modules' as the base for temporary directories when acquiring packages. This ensures that the package manager can inherit project-specific configuration (like '.npmrc' or '.yarnrc') during the installation of temporary packages. The implementation uses a fallback strategy, checking for candidate directories and defaulting to the system's temporary directory if none are found.
…on in ng add This change enhances the error handling in the 'ng add' command's 'installPackageTask'. It now specifically catches 'PackageManagerError' exceptions and surfaces the standard output or standard error from the underlying package manager process. This provides users with more actionable information when a package installation fails.
…directory This change adds support for copying package manager configuration files (like `bunfig.toml`) from the project root to the temporary directory used for acquiring packages. This is particularly necessary for Bun, which does not automatically inherit configuration from parent directories when running in a separate temporary location.
…gers This commit updates the `update-secure-registry` E2E test to skip unscoped authentication test cases when the active package manager is not Yarn, as other package managers may not support or correctly handle this setup in the test environment.
Bun does not support JSON output for the `pm ls` command. This commit introduces a custom parser to interpret Bun's tree-like output format, allowing the package manager abstraction to correctly discover installed dependencies when using Bun.
…mmand dependencies This commit refactors the `ng update` command to use the `PackageManager` abstraction for discovering installed dependencies, replacing the previous file-system-based resolution logic. This change improves correctness (respecting package manager resolution strategies like PnP and workspaces) and performance (reducing initial file I/O).
This commit updates the dependency discovery logic for Yarn Modern (Berry) to use the `yarn info --name-only --json` command, as the `list` command is not available in newer versions of Yarn.
…st output The `parseYarnClassicDependencies` function incorrectly parsed scoped packages (e.g., `@angular/[email protected]`) by splitting at the first `@`, resulting in an empty name. This commit updates the logic to split at the last `@`, ensuring scoped package names are correctly identified.
This change modernizes the `findUp` utility across the codebase. Replaced `path.parse().root` with `path.dirname(dir) === dir` check. Introduced an asynchronous version (`findUp`) in the CLI utility and renamed the synchronous version to `findUpSync` to align with Node.js conventions. Updated `packages/angular/cli/src/utilities/config.ts` to use the asynchronous `findUp` for non-blocking configuration discovery.
…ire.resolve This commit removes the `resolve` dependency from `@angular/cli` and replaces its usage with native `require.resolve` via `createRequire`. The `findPackageJson` utility is now only used in migration-only scenarios where the Node.js module caching behavior that prompted the original use of `resolve` is no longer a concern. This reduces the package dependency footprint.
This commit removes the unused `package-tree.ts` utilities, including `getProjectDependencies`, `readPackageJson`, and `PackageTreeNode`. The `findPackageJson` function, which was the only remaining used part, has been moved directly into `commands/update/cli.ts` where it is consumed.
Fixes crash when platform/app destroys itself during the bootstrapping and stabilization phase. Previously, the code would call `applicationRef.injector` without checking if the platform was destroyed, resulting in: "Error: Injector has already been destroyed" This can occur when: - Component constructor calls `inject(PlatformRef).destroy()` - AbortSignal triggers during request handling - APP_INITIALIZER rejects and causes cleanup - Custom guard/resolver logic destroys the platform Solution: Check `applicationRef.destroyed` after `whenStable()` and return error state instead of accessing destroyed injector. Test: Added test case that destroys app in component constructor to verify graceful handling of this edge case.
Update all copyright headers throughout the codebase to reflect the current legal entity name. This is a non-functional change that only affects the copyright notices in source files.
…ar material link Update all license URL references throughout the codebase to point to the new angular.dev domain. This is a non-functional change that only affects the license links in source file headers.
See associated pull request for more information.
See associated pull request for more information.
4b9b3ed
into
angular-indonesia:master
10 of 12 checks passed
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.
PR Checklist
Please check to confirm your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information