Skip to content
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
48 changes: 24 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,30 +97,30 @@ jobs:
- name: Run CLI E2E tests
run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }}

e2e_windows:
strategy:
fail-fast: false
matrix:
os: [windows-2025]
node: [22]
subset: [npm, esbuild]
shard: [0, 1, 2, 3, 4, 5]
runs-on: ${{ matrix.os }}
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@1f047e7dbae43ea969c2cafb53b33207e86b800f
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@1f047e7dbae43ea969c2cafb53b33207e86b800f
with:
allow_windows_rbe: true
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
- name: Run CLI E2E tests
uses: ./.github/shared-actions/windows-bazel-test
with:
test_target_name: e2e.${{ matrix.subset }}_node${{ matrix.node }}
env:
E2E_SHARD_TOTAL: 6
E2E_SHARD_INDEX: ${{ matrix.shard }}
# e2e_windows:
# strategy:
# fail-fast: false
# matrix:
# os: [windows-2025]
# node: [22]
# subset: [npm, esbuild]
# shard: [0, 1, 2, 3, 4, 5]
# runs-on: ${{ matrix.os }}
# steps:
# - name: Initialize environment
# uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@1f047e7dbae43ea969c2cafb53b33207e86b800f
# - name: Setup Bazel RBE
# uses: angular/dev-infra/github-actions/bazel/configure-remote@1f047e7dbae43ea969c2cafb53b33207e86b800f
# with:
# allow_windows_rbe: true
# google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
# - name: Run CLI E2E tests
# uses: ./.github/shared-actions/windows-bazel-test
# with:
# test_target_name: e2e.${{ matrix.subset }}_node${{ matrix.node }}
# env:
# E2E_SHARD_TOTAL: 6
# E2E_SHARD_INDEX: ${{ matrix.shard }}

e2e-package-managers:
needs: test
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/dev-infra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ jobs:
labels:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: angular/dev-infra/github-actions/commit-message-based-labels@1f047e7dbae43ea969c2cafb53b33207e86b800f
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: angular/dev-infra/github-actions/pull-request-labeling@3186a078ec23edea6e2f6192ed013ec57bd95f87
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
post_approval_changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: angular/dev-infra/github-actions/post-approval-changes@1f047e7dbae43ea969c2cafb53b33207e86b800f
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: angular/dev-infra/github-actions/post-approval-changes@3186a078ec23edea6e2f6192ed013ec57bd95f87
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
30 changes: 15 additions & 15 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,21 +125,21 @@ jobs:
- name: Run CLI E2E tests
run: pnpm bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }}

e2e-windows-subset:
needs: build
runs-on: windows-2025
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@1f047e7dbae43ea969c2cafb53b33207e86b800f
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@1f047e7dbae43ea969c2cafb53b33207e86b800f
with:
allow_windows_rbe: true
- name: Run CLI E2E tests
uses: ./.github/shared-actions/windows-bazel-test
with:
test_target_name: e2e_node22
test_args: --esbuild --glob "tests/basic/{build,rebuild}.ts"
# e2e-windows-subset:
# needs: build
# runs-on: windows-2025
# steps:
# - name: Initialize environment
# uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@1f047e7dbae43ea969c2cafb53b33207e86b800f
# - name: Setup Bazel RBE
# uses: angular/dev-infra/github-actions/bazel/configure-remote@1f047e7dbae43ea969c2cafb53b33207e86b800f
# with:
# allow_windows_rbe: true
# - name: Run CLI E2E tests
# uses: ./.github/shared-actions/windows-bazel-test
# with:
# test_target_name: e2e_node22
# test_args: --esbuild --glob "tests/basic/{build,rebuild}.ts"

e2e-package-managers:
needs: build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder } from '../setu
describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
describe('Option: "sourceMap"', () => {
it('should not generate script sourcemap files by default', async () => {
harness.useTarget('build', {
...BASE_OPTIONS,
sourceMap: undefined,
});
harness.useTarget('build', { ...BASE_OPTIONS, sourceMap: undefined });

const { result } = await harness.executeOnce();

Expand All @@ -25,10 +22,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
});

it('should not generate script sourcemap files when false', async () => {
harness.useTarget('build', {
...BASE_OPTIONS,
sourceMap: false,
});
harness.useTarget('build', { ...BASE_OPTIONS, sourceMap: false });

const { result } = await harness.executeOnce();

Expand All @@ -38,10 +32,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
});

it('should not generate script sourcemap files when scripts suboption is false', async () => {
harness.useTarget('build', {
...BASE_OPTIONS,
sourceMap: { scripts: false },
});
harness.useTarget('build', { ...BASE_OPTIONS, sourceMap: { scripts: false } });

const { result } = await harness.executeOnce();

Expand All @@ -51,10 +42,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
});

it('should generate script sourcemap files when true', async () => {
harness.useTarget('build', {
...BASE_OPTIONS,
sourceMap: true,
});
harness.useTarget('build', { ...BASE_OPTIONS, sourceMap: true });

const { result } = await harness.executeOnce();

Expand All @@ -64,10 +52,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
});

it('should generate script sourcemap files when scripts suboption is true', async () => {
harness.useTarget('build', {
...BASE_OPTIONS,
sourceMap: { scripts: true },
});
harness.useTarget('build', { ...BASE_OPTIONS, sourceMap: { scripts: true } });

const { result } = await harness.executeOnce();

Expand All @@ -79,10 +64,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
it('should not include third-party sourcemaps when true', async () => {
await harness.writeFile('src/polyfills.js', `console.log('main');`);

harness.useTarget('build', {
...BASE_OPTIONS,
sourceMap: true,
});
harness.useTarget('build', { ...BASE_OPTIONS, sourceMap: true });

const { result } = await harness.executeOnce();

Expand All @@ -95,10 +77,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
it('should not include third-party sourcemaps when vendor suboption is false', async () => {
await harness.writeFile('src/polyfills.js', `console.log('main');`);

harness.useTarget('build', {
...BASE_OPTIONS,
sourceMap: { scripts: true, vendor: false },
});
harness.useTarget('build', { ...BASE_OPTIONS, sourceMap: { scripts: true, vendor: false } });

const { result } = await harness.executeOnce();

Expand All @@ -111,17 +90,18 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
it('should include third-party sourcemaps when vendor suboption is true', async () => {
await harness.writeFile('src/polyfills.js', `console.log('main');`);

harness.useTarget('build', {
...BASE_OPTIONS,
sourceMap: { scripts: true, vendor: true },
});
harness.useTarget('build', { ...BASE_OPTIONS, sourceMap: { scripts: true, vendor: true } });

const { result } = await harness.executeOnce();

expect(result?.success).toBe(true);

harness.expectFile('dist/browser/main.js.map').content.toContain('/core/index.ts');
harness.expectFile('dist/browser/main.js.map').content.toContain('/common/index.ts');
harness
.expectFile('dist/browser/main.js.map')
.content.toContain('/core/src/application/application_ref.ts');
harness
.expectFile('dist/browser/main.js.map')
.content.toContain('/common/src/directives/ng_if.ts');
});

it(`should not include 'sourceMappingURL' sourcemaps when hidden suboption is true`, async () => {
Expand Down Expand Up @@ -193,10 +173,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
});

it('should add "x_google_ignoreList" extension to script sourcemap files when true', async () => {
harness.useTarget('build', {
...BASE_OPTIONS,
sourceMap: true,
});
harness.useTarget('build', { ...BASE_OPTIONS, sourceMap: true });

const { result } = await harness.executeOnce();

Expand All @@ -208,10 +185,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
it('should generate component sourcemaps when sourcemaps when true', async () => {
await harness.writeFile('src/app/app.component.css', `* { color: red}`);

harness.useTarget('build', {
...BASE_OPTIONS,
sourceMap: true,
});
harness.useTarget('build', { ...BASE_OPTIONS, sourceMap: true });

const { result } = await harness.executeOnce();

Expand All @@ -226,10 +200,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
it('should not generate component sourcemaps when sourcemaps when false', async () => {
await harness.writeFile('src/app/app.component.css', `* { color: red}`);

harness.useTarget('build', {
...BASE_OPTIONS,
sourceMap: false,
});
harness.useTarget('build', { ...BASE_OPTIONS, sourceMap: false });

const { result } = await harness.executeOnce();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,7 @@ describe('Browser Builder external source map', () => {
afterEach(async () => host.restore().toPromise());

it('works', async () => {
const overrides = {
sourceMap: {
scripts: true,
styles: true,
vendor: true,
},
};
const overrides = { sourceMap: { scripts: true, styles: true, vendor: true } };

const { files } = await browserBuild(architect, host, target, overrides);
const sourcePaths: string[] = JSON.parse(await files['vendor.js.map']).sources;
Expand All @@ -40,13 +34,7 @@ describe('Browser Builder external source map', () => {
});

it('does not map sourcemaps from external library when disabled', async () => {
const overrides = {
sourceMap: {
scripts: true,
styles: true,
vendor: false,
},
};
const overrides = { sourceMap: { scripts: true, styles: true, vendor: false } };

const { files } = await browserBuild(architect, host, target, overrides);
const sourcePaths: string[] = JSON.parse(await files['vendor.js.map']).sources;
Expand All @@ -71,12 +59,7 @@ describe('Identifying third-party code in source maps', () => {
afterEach(async () => host.restore().toPromise());

it('specifies which sources are third party when vendor processing is disabled', async () => {
const overrides = {
sourceMap: {
scripts: true,
vendor: false,
},
};
const overrides = { sourceMap: { scripts: true, vendor: false } };

const { files } = await browserBuild(architect, host, target, overrides);
const mainMap: SourceMap = JSON.parse(await files['main.js.map']);
Expand Down Expand Up @@ -104,11 +87,14 @@ describe('Identifying third-party code in source maps', () => {
expect(thirdPartyInVendor).toBe(true, `vendor.js.map should include some node modules`);

// All sources in the main map are first-party.
expect(mainMap.sources.filter((_, i) => !mainMap[IGNORE_LIST].includes(i))).toEqual([
const sources = mainMap.sources.filter((_, i) => !mainMap[IGNORE_LIST].includes(i));
sources.sort();

expect(sources).toEqual([
'./src/app/app.component.css',
'./src/app/app.component.ts',
'./src/app/app.module.ts',
'./src/main.ts',
'./src/app/app.component.css',
]);

// Only some sources in the polyfills map are first-party.
Expand Down
Loading
Loading