Skip to content

Commit

Permalink
Remove Angular/core version check from Firebase Angular buildpack
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 679305170
Change-Id: I5e52f1f44d8861280555c3019289633b12ed9f2c
  • Loading branch information
GCP Buildpacks Team authored and copybara-github committed Sep 26, 2024
1 parent 088d3b6 commit 23eb788
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 34 deletions.
14 changes: 2 additions & 12 deletions cmd/nodejs/firebaseangular/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,6 @@ func buildFn(ctx *gcp.Context) error {
if err != nil {
return err
}
// Check that we support this version of angular.
version, err := nodejs.Version(nodeDeps, "@angular/core")
if err != nil {
ctx.Warnf("Error parsing version from lock file, defaulting to package.json version")
version = nodeDeps.PackageJSON.Dependencies["@angular/core"]
}
err = validateVersion(ctx, version)
if err != nil {
return err
}
// Ensure that the right version of the application builder is installed.
builderVersion, err := nodejs.Version(nodeDeps, "@angular-devkit/build-angular")
if err != nil {
Expand Down Expand Up @@ -113,12 +103,12 @@ func buildFn(ctx *gcp.Context) error {
if err != nil {
return err
}
if err = nodejs.InstallAngularBuildAdaptor(ctx, al, version); err != nil {
if err = nodejs.InstallAngularBuildAdaptor(ctx, al, builderVersion); err != nil {
return err
}

// pass angular version as environment variable that will configure the build for version matching
al.BuildEnvironment.Override(frameworkVersion, version)
al.BuildEnvironment.Override(frameworkVersion, builderVersion)

// This env var indicates to the package manager buildpack that a different command needs to be run
nodejs.OverrideAngularBuildScript(al)
Expand Down
22 changes: 0 additions & 22 deletions cmd/nodejs/firebaseangular/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,28 +208,6 @@ func TestBuild(t *testing.T) {
"npm install --prefix npm_modules @apphosting/adapter-angular@" + nodejs.PinnedAngularAdapterVersion,
},
},
{
name: "error out if core version is below 17.2.0",
files: map[string]string{
"package.json": `{
"dependencies": {
"@angular/core": "17.0.0",
"@angular-devkit/build-angular": "17.2.0"
}
}`,
"package-lock.json": `{
"packages": {
"node_modules/@angular/core": {
"version": "17.0.0"
},
"node_modules/@angular-devkit/build-angular": {
"version": "17.2.0"
}
}
}`,
},
wantExitCode: 1,
},
{
name: "error out if the builder version is below 17.2.0",
files: map[string]string{
Expand Down

0 comments on commit 23eb788

Please sign in to comment.