Skip to content

Commit

Permalink
Merge pull request #883 from angular/main
Browse files Browse the repository at this point in the history
Create a new pull request by comparing changes across two branches
  • Loading branch information
GulajavaMinistudio authored Apr 2, 2024
2 parents d3244f4 + f97c0f3 commit b7e268b
Show file tree
Hide file tree
Showing 20 changed files with 209 additions and 162 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/assistant-to-the-branch-manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
persist-credentials: false
- uses: angular/dev-infra/github-actions/branch-manager@8af6b55a8b31cd9e632823cf8f2dd1e89caa6f4f
- uses: angular/dev-infra/github-actions/branch-manager@4b433074a806bbbd4d319264430740cd46e62f27
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
36 changes: 18 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@8af6b55a8b31cd9e632823cf8f2dd1e89caa6f4f
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4b433074a806bbbd4d319264430740cd46e62f27
- name: Setup ESLint Caching
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
Expand Down Expand Up @@ -75,11 +75,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@8af6b55a8b31cd9e632823cf8f2dd1e89caa6f4f
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4b433074a806bbbd4d319264430740cd46e62f27
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@8af6b55a8b31cd9e632823cf8f2dd1e89caa6f4f
uses: angular/dev-infra/github-actions/bazel/setup@4b433074a806bbbd4d319264430740cd46e62f27
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@8af6b55a8b31cd9e632823cf8f2dd1e89caa6f4f
uses: angular/dev-infra/github-actions/bazel/configure-remote@4b433074a806bbbd4d319264430740cd46e62f27
- name: Install node modules
run: yarn install --frozen-lockfile
- name: Build release targets
Expand All @@ -96,11 +96,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@8af6b55a8b31cd9e632823cf8f2dd1e89caa6f4f
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4b433074a806bbbd4d319264430740cd46e62f27
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@8af6b55a8b31cd9e632823cf8f2dd1e89caa6f4f
uses: angular/dev-infra/github-actions/bazel/setup@4b433074a806bbbd4d319264430740cd46e62f27
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@8af6b55a8b31cd9e632823cf8f2dd1e89caa6f4f
uses: angular/dev-infra/github-actions/bazel/configure-remote@4b433074a806bbbd4d319264430740cd46e62f27
- name: Install node modules
run: yarn install --frozen-lockfile
- name: Run tests
Expand Down Expand Up @@ -128,13 +128,13 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@8af6b55a8b31cd9e632823cf8f2dd1e89caa6f4f
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4b433074a806bbbd4d319264430740cd46e62f27
- name: Install node modules
run: yarn install --frozen-lockfile
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@8af6b55a8b31cd9e632823cf8f2dd1e89caa6f4f
uses: angular/dev-infra/github-actions/bazel/setup@4b433074a806bbbd4d319264430740cd46e62f27
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@8af6b55a8b31cd9e632823cf8f2dd1e89caa6f4f
uses: angular/dev-infra/github-actions/bazel/configure-remote@4b433074a806bbbd4d319264430740cd46e62f27
- name: Run CLI E2E tests
run: yarn bazel test --define=E2E_SHARD_TOTAL=6 --define=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }}

Expand All @@ -151,13 +151,13 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@8af6b55a8b31cd9e632823cf8f2dd1e89caa6f4f
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4b433074a806bbbd4d319264430740cd46e62f27
- name: Install node modules
run: yarn install --frozen-lockfile
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@8af6b55a8b31cd9e632823cf8f2dd1e89caa6f4f
uses: angular/dev-infra/github-actions/bazel/setup@4b433074a806bbbd4d319264430740cd46e62f27
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@8af6b55a8b31cd9e632823cf8f2dd1e89caa6f4f
uses: angular/dev-infra/github-actions/bazel/configure-remote@4b433074a806bbbd4d319264430740cd46e62f27
- name: Run CLI E2E tests
run: yarn bazel test --define=E2E_SHARD_TOTAL=6 --define=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.snapshots.${{ matrix.subset }}_node${{ matrix.node }}

Expand All @@ -169,13 +169,13 @@ jobs:
SAUCE_TUNNEL_IDENTIFIER: angular-cli-${{ github.workflow }}-${{ github.run_number }}
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@8af6b55a8b31cd9e632823cf8f2dd1e89caa6f4f
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4b433074a806bbbd4d319264430740cd46e62f27
- name: Install node modules
run: yarn install --frozen-lockfile
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@8af6b55a8b31cd9e632823cf8f2dd1e89caa6f4f
uses: angular/dev-infra/github-actions/bazel/setup@4b433074a806bbbd4d319264430740cd46e62f27
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@8af6b55a8b31cd9e632823cf8f2dd1e89caa6f4f
uses: angular/dev-infra/github-actions/bazel/configure-remote@4b433074a806bbbd4d319264430740cd46e62f27
- name: Run E2E Browser tests
env:
SAUCE_USERNAME: ${{ vars.SAUCE_USERNAME }}
Expand Down Expand Up @@ -203,11 +203,11 @@ jobs:
CIRCLE_BRANCH: ${{ github.ref_name }}
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@8af6b55a8b31cd9e632823cf8f2dd1e89caa6f4f
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4b433074a806bbbd4d319264430740cd46e62f27
- name: Install node modules
run: yarn install --frozen-lockfile
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@8af6b55a8b31cd9e632823cf8f2dd1e89caa6f4f
uses: angular/dev-infra/github-actions/bazel/setup@4b433074a806bbbd4d319264430740cd46e62f27
- run: yarn admin snapshots --verbose
env:
SNAPSHOT_BUILDS_GITHUB_TOKEN: ${{ secrets.SNAPSHOT_BUILDS_GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/dev-infra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: angular/dev-infra/github-actions/commit-message-based-labels@8af6b55a8b31cd9e632823cf8f2dd1e89caa6f4f
- uses: angular/dev-infra/github-actions/commit-message-based-labels@4b433074a806bbbd4d319264430740cd46e62f27
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
post_approval_changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: angular/dev-infra/github-actions/post-approval-changes@8af6b55a8b31cd9e632823cf8f2dd1e89caa6f4f
- uses: angular/dev-infra/github-actions/post-approval-changes@4b433074a806bbbd4d319264430740cd46e62f27
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
2 changes: 1 addition & 1 deletion .github/workflows/feature-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ jobs:
if: github.repository == 'angular/angular-cli'
runs-on: ubuntu-latest
steps:
- uses: angular/dev-infra/github-actions/feature-request@8af6b55a8b31cd9e632823cf8f2dd1e89caa6f4f
- uses: angular/dev-infra/github-actions/feature-request@4b433074a806bbbd4d319264430740cd46e62f27
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
<a name="18.0.0-next.1"></a>

# 18.0.0-next.1 (2024-03-28)

### @schematics/angular

| Commit | Type | Description |
| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------------- |
| [6530aa11b](https://github.com/angular/angular-cli/commit/6530aa11bed5ef67d611e8aed268bd20345cf0e6) | feat | replace `assets` with `public` directory |
| [950a44521](https://github.com/angular/angular-cli/commit/950a44521fdfb82000f6564ccc4c87d4a2b94680) | fix | rename SSR port env variable |

### @angular-devkit/build-angular

| Commit | Type | Description |
| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------------------- |
| [e22d6771d](https://github.com/angular/angular-cli/commit/e22d6771da9f289577410b66d3fd8763b12113b2) | fix | ensure proper resolution of linked SCSS files |
| [c71e954a2](https://github.com/angular/angular-cli/commit/c71e954a25f0c6949b0dcebf3dfa01bd10a188b0) | fix | service-worker references non-existent named index output |

<!-- CHANGELOG SPLIT MARKER -->

<a name="17.3.2"></a>

# 17.3.2 (2024-03-25)
Expand Down
40 changes: 20 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@angular/devkit-repo",
"version": "18.0.0-next.0",
"version": "18.0.0-next.1",
"private": true,
"description": "Software Development Kit for Angular",
"keywords": [
Expand Down Expand Up @@ -51,23 +51,23 @@
},
"devDependencies": {
"@ampproject/remapping": "2.3.0",
"@angular/animations": "18.0.0-next.1",
"@angular/bazel": "https://github.com/angular/bazel-builds.git#f0c522de0e15e2eac42bb0fa9525103bdc72bf4b",
"@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#b60378db662fba684feb5ed9aa1ec319d7c77354",
"@angular/cdk": "18.0.0-next.1",
"@angular/common": "18.0.0-next.1",
"@angular/compiler": "18.0.0-next.1",
"@angular/compiler-cli": "18.0.0-next.1",
"@angular/core": "18.0.0-next.1",
"@angular/forms": "18.0.0-next.1",
"@angular/localize": "18.0.0-next.1",
"@angular/material": "18.0.0-next.1",
"@angular/ng-dev": "https://github.com/angular/dev-infra-private-ng-dev-builds.git#87b7674b7dfe7abeb565f555cd19a9760ee46c72",
"@angular/platform-browser": "18.0.0-next.1",
"@angular/platform-browser-dynamic": "18.0.0-next.1",
"@angular/platform-server": "18.0.0-next.1",
"@angular/router": "18.0.0-next.1",
"@angular/service-worker": "18.0.0-next.1",
"@angular/animations": "18.0.0-next.2",
"@angular/bazel": "https://github.com/angular/bazel-builds.git#2117485242aa8e10e39cd130287298521814110a",
"@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#9831b1aa2e40b8fdf1ebd44650797b5fd4ba08c3",
"@angular/cdk": "18.0.0-next.2",
"@angular/common": "18.0.0-next.2",
"@angular/compiler": "18.0.0-next.2",
"@angular/compiler-cli": "18.0.0-next.2",
"@angular/core": "18.0.0-next.2",
"@angular/forms": "18.0.0-next.2",
"@angular/localize": "18.0.0-next.2",
"@angular/material": "18.0.0-next.2",
"@angular/ng-dev": "https://github.com/angular/dev-infra-private-ng-dev-builds.git#a8690b0870728efc1aea5eb6644e605e7d37eabc",
"@angular/platform-browser": "18.0.0-next.2",
"@angular/platform-browser-dynamic": "18.0.0-next.2",
"@angular/platform-server": "18.0.0-next.2",
"@angular/router": "18.0.0-next.2",
"@angular/service-worker": "18.0.0-next.2",
"@babel/core": "7.24.3",
"@babel/generator": "7.24.1",
"@babel/helper-annotate-as-pure": "7.22.5",
Expand All @@ -78,7 +78,7 @@
"@babel/preset-env": "7.24.3",
"@babel/runtime": "7.24.1",
"@bazel/bazelisk": "1.19.0",
"@bazel/buildifier": "6.4.0",
"@bazel/buildifier": "7.1.0",
"@bazel/concatjs": "5.8.1",
"@bazel/esbuild": "5.8.1",
"@bazel/jasmine": "5.8.1",
Expand Down Expand Up @@ -118,7 +118,7 @@
"@web/test-runner": "^0.18.0",
"@yarnpkg/lockfile": "1.1.0",
"ajv": "8.12.0",
"ajv-formats": "2.1.1",
"ajv-formats": "3.0.1",
"ansi-colors": "4.1.3",
"autoprefixer": "10.4.19",
"babel-loader": "9.1.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/angular_devkit/build_angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"ng-packagr": "^18.0.0-next.0",
"protractor": "^7.0.0",
"tailwindcss": "^2.0.0 || ^3.0.0",
"typescript": ">=5.2 <5.5"
"typescript": ">=5.4 <5.5"
},
"peerDependenciesMeta": {
"@angular/localize": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ import { createHash } from 'node:crypto';
import { readFile, rm, writeFile } from 'node:fs/promises';
import * as https from 'node:https';
import { join } from 'node:path';
import { URL } from 'node:url';
import { NormalizedCachedOptions } from '../normalize-cache';
import { VERSION } from '../package-version';
import { htmlRewritingStream } from './html-rewriting-stream';

interface FontProviderDetails {
Expand Down Expand Up @@ -173,7 +171,7 @@ export class InlineFontsProcessor {
private async getResponse(url: URL): Promise<string> {
let cacheFile;
if (this.cachePath) {
const key = createHash(CONTENT_HASH_ALGORITHM).update(`${VERSION}|${url}`).digest('hex');
const key = createHash(CONTENT_HASH_ALGORITHM).update(`${url}`).digest('hex');
cacheFile = join(this.cachePath, key);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
* found in the LICENSE file at https://angular.io/license
*/

import { join, resolve } from 'path';
import { VERSION } from './package-version';
import { join, resolve } from 'node:path';

/** Version placeholder is replaced during the build process with actual package version */
const VERSION = '0.0.0-PLACEHOLDER';

export interface NormalizedCachedOptions {
/** Whether disk cache is enabled. */
Expand Down
2 changes: 1 addition & 1 deletion packages/angular_devkit/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"./*.js": "./*.js"
},
"dependencies": {
"ajv-formats": "2.1.1",
"ajv-formats": "3.0.1",
"ajv": "8.12.0",
"jsonc-parser": "3.2.1",
"picomatch": "4.0.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/ngtools/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
"dependencies": {},
"peerDependencies": {
"@angular/compiler-cli": "^18.0.0-next.0",
"typescript": ">=5.2 <5.5",
"typescript": ">=5.4 <5.5",
"webpack": "^5.54.0"
},
"devDependencies": {
"@angular-devkit/core": "0.0.0-PLACEHOLDER",
"@angular/compiler": "18.0.0-next.1",
"@angular/compiler-cli": "18.0.0-next.1",
"@angular/compiler": "18.0.0-next.2",
"@angular/compiler-cli": "18.0.0-next.2",
"typescript": "5.4.3",
"webpack": "5.91.0"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@

import { AppModule } from './app/app.module';

<% if(!!viewEncapsulation) { %>
platformBrowserDynamic().bootstrapModule(AppModule, {
defaultEncapsulation: ViewEncapsulation.<%= viewEncapsulation %>
ngZoneEventCoalescing: true<% if(!!viewEncapsulation) { %>,
defaultEncapsulation: ViewEncapsulation.<%= viewEncapsulation %><% } %>
})
.catch(err => console.error(err));<% } else { %>
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
<% } %>
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ApplicationConfig } from '@angular/core';<% if (routing) { %>
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';<% if (routing) { %>
import { provideRouter } from '@angular/router';

import { routes } from './app.routes';<% } %>

export const appConfig: ApplicationConfig = {
providers: [<% if (routing) { %>provideRouter(routes)<% } %>]
providers: [provideZoneChangeDetection({ eventCoalescing: true })<% if (routing) { %>, provideRouter(routes)<% } %>]
};
22 changes: 22 additions & 0 deletions packages/schematics/angular/application/index_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,14 @@ describe('Application Schematic', () => {
expect(moduleFiles.length).toEqual(0);
});

it('should enable zone event coalescing by default', async () => {
const options = { ...defaultOptions, standalone: true };

const tree = await schematicRunner.runSchematic('application', options, workspaceTree);
const appConfig = tree.readContent('/projects/foo/src/app/app.config.ts');
expect(appConfig).toContain('provideZoneChangeDetection({ eventCoalescing: true })');
});

it('should create a standalone component', async () => {
const options = { ...defaultOptions, standalone: true };

Expand Down Expand Up @@ -575,6 +583,20 @@ describe('Application Schematic', () => {
});

describe('standalone=false', () => {
it('should add the ngZoneEventCoalescing option by default', async () => {
const tree = await schematicRunner.runSchematic(
'application',
{
...defaultOptions,
standalone: false,
},
workspaceTree,
);

const content = tree.readContent('/projects/foo/src/main.ts');
expect(content).toContain('ngZoneEventCoalescing: true');
});

it(`should set 'defaultEncapsulation' in main.ts when 'ViewEncapsulation' is provided`, async () => {
const tree = await schematicRunner.runSchematic(
'application',
Expand Down
2 changes: 1 addition & 1 deletion packages/schematics/angular/server/index_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ describe('Server Schematic', () => {
it(`should add 'provideClientHydration' to the providers list`, async () => {
const tree = await schematicRunner.runSchematic('server', defaultOptions, appTree);
const contents = tree.readContent('/projects/bar/src/app/app.config.ts');
expect(contents).toContain(`providers: [provideClientHydration()]`);
expect(contents).toContain(`provideClientHydration()`);
});
});

Expand Down
12 changes: 7 additions & 5 deletions packages/schematics/angular/service-worker/index_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,19 @@ describe('Service Worker Schematic', () => {
const tree = await schematicRunner.runSchematic('service-worker', defaultOptions, appTree);
const content = tree.readContent('/projects/bar/src/app/app.config.ts');
expect(tags.oneLine`${content}`).toContain(tags.oneLine`
providers: [provideServiceWorker('ngsw-worker.js', {
enabled: !isDevMode(),
registrationStrategy: 'registerWhenStable:30000'
})]
provideServiceWorker('ngsw-worker.js', {
enabled: !isDevMode(),
registrationStrategy: 'registerWhenStable:30000'
})
`);
});

it(`should import 'isDevMode' from '@angular/core'`, async () => {
const tree = await schematicRunner.runSchematic('service-worker', defaultOptions, appTree);
const content = tree.readContent('/projects/bar/src/app/app.config.ts');
expect(content).toContain(`import { ApplicationConfig, isDevMode } from '@angular/core';`);
expect(content).toContain(
`import { ApplicationConfig, provideZoneChangeDetection, isDevMode } from '@angular/core';`,
);
});

it(`should import 'provideServiceWorker' from '@angular/service-worker'`, async () => {
Expand Down
Loading

0 comments on commit b7e268b

Please sign in to comment.