Skip to content

Commit

Permalink
test: ensure to use the correct version for @angular/ssr packages
Browse files Browse the repository at this point in the history
This commit fixes an issue that causes update tests to fail when we are in feature freeze
  • Loading branch information
alan-agius4 committed Oct 12, 2023
1 parent 55422d5 commit 62aa739
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default function (): Rule {
removePackageJsonDependency(tree, '@nguniversal/express-engine');
removePackageJsonDependency(tree, '@nguniversal/common');
},
addDependency('@angular/ssr', latestVersions.Angular),
addDependency('@angular/ssr', latestVersions.AngularSSR),
]);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/schematics/angular/ssr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ function updateWebpackBuilderServerTsConfigRule(options: SSROptions): Rule {

function addDependencies(): Rule {
return chain([
addDependency('@angular/ssr', '^0.0.0-PLACEHOLDER', {
addDependency('@angular/ssr', latestVersions.AngularSSR, {
type: DependencyType.Default,
}),
addDependency('express', latestVersions['express'], {
Expand Down
7 changes: 3 additions & 4 deletions packages/schematics/angular/utility/latest-versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
export const latestVersions: Record<string, string> & {
Angular: string;
DevkitBuildAngular: string;
AngularSSR: string;
} = {
// We could have used TypeScripts' `resolveJsonModule` to make the `latestVersion` object typesafe,
// but ts_library doesn't support JSON inputs.
Expand All @@ -17,8 +18,6 @@ export const latestVersions: Record<string, string> & {
// As Angular CLI works with same minor versions of Angular Framework, a tilde match for the current
Angular: '^17.0.0-next.0',

// Since @angular-devkit/build-angular and @schematics/angular are always
// published together from the same monorepo, and they are both
// non-experimental, they will always have the same version.
DevkitBuildAngular: '^' + require('../package.json')['version'],
DevkitBuildAngular: '^0.0.0-PLACEHOLDER',
AngularSSR: '^0.0.0-PLACEHOLDER',
};

0 comments on commit 62aa739

Please sign in to comment.