Skip to content

Commit

Permalink
Merge pull request #1125 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 Oct 9, 2024
2 parents 352c5ad + 7c50ba9 commit f443b1b
Show file tree
Hide file tree
Showing 14 changed files with 147 additions and 112 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 @@ -13,7 +13,7 @@ jobs:
assistant_to_the_branch_manager:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
persist-credentials: false
- uses: angular/dev-infra/github-actions/branch-manager@46771fcd70e08e7ba3c30f4ee9ebf9971b7fdb5c
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ jobs:
./scripts/saucelabs/wait-for-tunnel.sh
yarn bazel test --config=saucelabs //tests/legacy-cli:e2e.saucelabs
./scripts/saucelabs/stop-tunnel.sh
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
- uses: actions/upload-artifact@604373da6381bf24206979c74d06a550515601b9 # v4.4.1
if: ${{ failure() }}
with:
name: sauce-connect-log
Expand Down
4 changes: 2 additions & 2 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@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: angular/dev-infra/github-actions/commit-message-based-labels@46771fcd70e08e7ba3c30f4ee9ebf9971b7fdb5c
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
post_approval_changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: angular/dev-infra/github-actions/post-approval-changes@46771fcd70e08e7ba3c30f4ee9ebf9971b7fdb5c
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
6 changes: 3 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
outputs:
snapshots: ${{ steps.filter.outputs.snapshots }}
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
persist-credentials: false
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
Expand All @@ -36,7 +36,7 @@ jobs:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@46771fcd70e08e7ba3c30f4ee9ebf9971b7fdb5c
- name: Setup ESLint Caching
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache@2cdf405574d6ef1f33a1d12acccd3ae82f47b3f2 # v4.1.0
with:
path: .eslintcache
key: ${{ runner.os }}-${{ hashFiles('.eslintrc.json') }}
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
- name: Build release targets
run: yarn ng-dev release build
- name: Store PR release packages
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
uses: actions/upload-artifact@604373da6381bf24206979c74d06a550515601b9 # v4.4.1
with:
name: packages
path: dist/releases/*.tgz
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

steps:
- name: 'Checkout code'
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
persist-credentials: false

Expand All @@ -38,14 +38,14 @@ jobs:

# Upload the results as artifacts.
- name: 'Upload artifact'
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
uses: actions/upload-artifact@604373da6381bf24206979c74d06a550515601b9 # v4.4.1
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard.
- name: 'Upload to code-scanning'
uses: github/codeql-action/upload-sarif@6db8d6351fd0be61f9ed8ebd12ccd35dcec51fea # v3.26.11
uses: github/codeql-action/upload-sarif@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12
with:
sarif_file: results.sarif
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"@discoveryjs/json-ext": "0.6.1",
"@inquirer/confirm": "5.0.0",
"@inquirer/prompts": "7.0.0",
"@listr2/prompt-adapter-inquirer": "2.0.16",
"@listr2/prompt-adapter-inquirer": "2.0.17",
"@rollup/plugin-commonjs": "^28.0.0",
"@rollup/plugin-node-resolve": "^13.0.5",
"@stylistic/eslint-plugin": "^2.8.0",
Expand All @@ -114,8 +114,8 @@
"@types/yargs": "^17.0.20",
"@types/yargs-parser": "^21.0.0",
"@types/yarnpkg__lockfile": "^1.1.5",
"@typescript-eslint/eslint-plugin": "8.8.0",
"@typescript-eslint/parser": "8.8.0",
"@typescript-eslint/eslint-plugin": "8.8.1",
"@typescript-eslint/parser": "8.8.1",
"@vitejs/plugin-basic-ssl": "1.1.0",
"@web/test-runner": "^0.19.0",
"@yarnpkg/lockfile": "1.1.0",
Expand All @@ -137,11 +137,11 @@
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-header": "3.1.1",
"eslint-plugin-import": "2.30.0",
"eslint-plugin-import": "2.31.0",
"express": "4.21.0",
"fast-glob": "3.3.2",
"http-proxy": "^1.18.1",
"http-proxy-middleware": "3.0.2",
"http-proxy-middleware": "3.0.3",
"https-proxy-agent": "7.0.5",
"husky": "9.1.6",
"ini": "5.0.0",
Expand All @@ -159,7 +159,7 @@
"less": "4.2.0",
"less-loader": "12.2.0",
"license-webpack-plugin": "4.0.2",
"listr2": "8.2.4",
"listr2": "8.2.5",
"lmdb": "3.1.3",
"loader-utils": "3.3.1",
"lodash": "^4.17.21",
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"fast-glob": "3.3.2",
"https-proxy-agent": "7.0.5",
"istanbul-lib-instrument": "6.0.3",
"listr2": "8.2.4",
"listr2": "8.2.5",
"lmdb": "3.1.3",
"magic-string": "0.30.11",
"mrmime": "2.0.0",
Expand Down
26 changes: 13 additions & 13 deletions packages/angular/build/src/builders/application/build-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,6 @@ export async function* runEsBuildBuildAction(
`${workspaceRoot.replace(/\\/g, '/')}/**/.*/**`,
];

if (!preserveSymlinks) {
// Ignore all node modules directories to avoid excessive file watchers.
// Package changes are handled below by watching manifest and lock files.
// NOTE: this is not enable when preserveSymlinks is true as this would break `npm link` usages.
ignored.push('**/node_modules/**');
}

// Setup a watcher
const { createWatcher } = await import('../../tools/esbuild/watcher');
watcher = createWatcher({
Expand All @@ -119,15 +112,22 @@ export async function* runEsBuildBuildAction(

// Watch the entire project root if 'NG_BUILD_WATCH_ROOT' environment variable is set
if (shouldWatchRoot) {
if (!preserveSymlinks) {
// Ignore all node modules directories to avoid excessive file watchers.
// Package changes are handled below by watching manifest and lock files.
// NOTE: this is not enable when preserveSymlinks is true as this would break `npm link` usages.
ignored.push('**/node_modules/**');

watcher.add(
packageWatchFiles
.map((file) => path.join(workspaceRoot, file))
.filter((file) => existsSync(file)),
);
}

watcher.add(projectRoot);
}

watcher.add(
packageWatchFiles
.map((file) => path.join(workspaceRoot, file))
.filter((file) => existsSync(file)),
);

// Watch locations provided by the initial build result
watcher.add(result.watchFiles);
}
Expand Down
8 changes: 7 additions & 1 deletion packages/angular/build/src/builders/application/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,16 @@ export async function normalizeOptions(
* If SSR is activated, create a distinct entry file for the `index.html`.
* This is necessary because numerous server/cloud providers automatically serve the `index.html` as a static file
* if it exists (handling SSG).
*
* For instance, accessing `foo.com/` would lead to `foo.com/index.html` being served instead of hitting the server.
*
* This approach can also be applied to service workers, where the `index.csr.html` is served instead of the prerendered `index.html`.
*/
const indexBaseName = path.basename(options.index);
indexOutput = ssrOptions && indexBaseName === 'index.html' ? INDEX_HTML_CSR : indexBaseName;
indexOutput =
(ssrOptions || prerenderOptions) && indexBaseName === 'index.html'
? INDEX_HTML_CSR
: indexBaseName;
} else {
indexOutput = options.index.output || 'index.html';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,9 @@ async function getAllRoutes(
assertIsError(err);

return {
errors: [`An error occurred while extracting routes.\n\n${err.stack}`],
errors: [
`An error occurred while extracting routes.\n\n${err.stack ?? err.message ?? err.code ?? err}`,
],
serializedRouteTree: [],
};
} finally {
Expand Down
4 changes: 2 additions & 2 deletions packages/angular/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
"@angular-devkit/core": "0.0.0-PLACEHOLDER",
"@angular-devkit/schematics": "0.0.0-PLACEHOLDER",
"@inquirer/prompts": "7.0.0",
"@listr2/prompt-adapter-inquirer": "2.0.16",
"@listr2/prompt-adapter-inquirer": "2.0.17",
"@schematics/angular": "0.0.0-PLACEHOLDER",
"@yarnpkg/lockfile": "1.1.0",
"ini": "5.0.0",
"jsonc-parser": "3.3.1",
"listr2": "8.2.4",
"listr2": "8.2.5",
"npm-package-arg": "12.0.0",
"npm-pick-manifest": "10.0.0",
"pacote": "19.0.0",
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 @@ -32,7 +32,7 @@
"css-loader": "7.1.2",
"esbuild-wasm": "0.24.0",
"fast-glob": "3.3.2",
"http-proxy-middleware": "3.0.2",
"http-proxy-middleware": "3.0.3",
"https-proxy-agent": "7.0.5",
"istanbul-lib-instrument": "6.0.3",
"jsonc-parser": "3.3.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,19 @@ export default async function () {
return;
}

await ng('build', projectName, '--configuration=production', '--prerender');
await ng('build', projectName, '--configuration=production', '--prerender', '--no-ssr');
await runExpects();

// Test also JIT mode.
await ng('build', projectName, '--configuration=development', '--prerender', '--no-aot');
await ng(
'build',
projectName,
'--configuration=development',
'--prerender',
'--no-ssr',
'--no-aot',
);

await runExpects();

async function runExpects(): Promise<void> {
Expand All @@ -136,6 +144,10 @@ export default async function () {
'lazy-two/index.html': 'lazy-two works!',
};

if (!useWebpackBuilder) {
expects['index.csr.html'] = '<app-root></app-root>';
}

const distPath = 'dist/' + projectName + '/browser';
for (const [filePath, fileMatch] of Object.entries(expects)) {
await expectFileToMatch(join(distPath, filePath), fileMatch);
Expand Down
Loading

0 comments on commit f443b1b

Please sign in to comment.