|
6 | 6 | * found in the LICENSE file at https://angular.io/license
|
7 | 7 | */
|
8 | 8 |
|
9 |
| -import {promises as fs} from 'fs'; |
10 |
| -import {join} from 'path'; |
| 9 | +import {promises as fs, existsSync} from 'fs'; |
| 10 | +import path, {join} from 'path'; |
11 | 11 | import semver from 'semver';
|
12 | 12 |
|
13 | 13 | import {workspaceRelativePackageJsonPath} from '../../utils/constants.js';
|
@@ -41,6 +41,7 @@ import {githubReleaseBodyLimit} from './constants.js';
|
41 | 41 | import {ExternalCommands} from './external-commands.js';
|
42 | 42 | import {promptToInitiatePullRequestMerge} from './prompt-merge.js';
|
43 | 43 | import {Prompt} from '../../utils/prompt.js';
|
| 44 | +import {glob} from 'fast-glob'; |
44 | 45 |
|
45 | 46 | /** Interface describing a Github repository. */
|
46 | 47 | export interface GithubRepo {
|
@@ -129,6 +130,10 @@ export abstract class ReleaseAction {
|
129 | 130 | // to avoid unnecessary diff. IDEs usually add a trailing new line.
|
130 | 131 | await fs.writeFile(pkgJsonPath, `${JSON.stringify(pkgJson, null, 2)}\n`);
|
131 | 132 | Log.info(green(` ✓ Updated project version to ${pkgJson.version}`));
|
| 133 | + |
| 134 | + if (this.config.rulesJsInteropMode && existsSync(path.join(this.projectDir, '.aspect'))) { |
| 135 | + await ExternalCommands.invokeBazelUpdateAspectLockFiles(this.projectDir); |
| 136 | + } |
132 | 137 | }
|
133 | 138 |
|
134 | 139 | /** Gets the most recent commit of a specified branch. */
|
@@ -217,11 +222,16 @@ export abstract class ReleaseAction {
|
217 | 222 | // Commit message for the release point.
|
218 | 223 | const commitMessage = getCommitMessageForRelease(newVersion);
|
219 | 224 |
|
| 225 | + const filesToCommit = [workspaceRelativePackageJsonPath, workspaceRelativeChangelogPath]; |
| 226 | + |
| 227 | + // Ensure modified Aspect lock files are included in the release commit. |
| 228 | + // TODO: Remove after `rules_js` migration is complete. |
| 229 | + if (this.config.rulesJsInteropMode) { |
| 230 | + filesToCommit.push(...glob.sync(['.aspect/**', 'pnpm-lock.yaml'], {cwd: this.projectDir})); |
| 231 | + } |
| 232 | + |
220 | 233 | // Create a release staging commit including changelog and version bump.
|
221 |
| - await this.createCommit(commitMessage, [ |
222 |
| - workspaceRelativePackageJsonPath, |
223 |
| - workspaceRelativeChangelogPath, |
224 |
| - ]); |
| 234 | + await this.createCommit(commitMessage, filesToCommit); |
225 | 235 |
|
226 | 236 | // The caretaker may have attempted to make additional changes. These changes would
|
227 | 237 | // not be captured into the release commit. The working directory should remain clean,
|
|
0 commit comments