Skip to content

Commit

Permalink
Merge branch 'main' into chore/build-error-types
Browse files Browse the repository at this point in the history
  • Loading branch information
JGAntunes authored Nov 9, 2023
2 parents 17391ea + fd75258 commit 558c79e
Show file tree
Hide file tree
Showing 10 changed files with 216 additions and 128 deletions.
6 changes: 3 additions & 3 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"packages/build-info": "7.10.2",
"packages/build": "29.26.1",
"packages/build-info": "7.11.1",
"packages/build": "29.26.3",
"packages/cache-utils": "5.1.5",
"packages/config": "20.9.0",
"packages/framework-info": "9.8.10",
"packages/functions-utils": "5.2.39",
"packages/functions-utils": "5.2.40",
"packages/git-utils": "5.1.1",
"packages/headers-parser": "7.1.2",
"packages/js-client": "13.1.10",
Expand Down
226 changes: 113 additions & 113 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions packages/build-info/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,20 @@
* dependencies
* @netlify/framework-info bumped from ^9.8.8 to ^9.8.9

## [7.11.1](https://github.com/netlify/build/compare/build-info-v7.11.0...build-info-v7.11.1) (2023-11-09)


### Bug Fixes

* for angular v17, detect publish directory from `angular.json` ([#5373](https://github.com/netlify/build/issues/5373)) ([5cf6370](https://github.com/netlify/build/commit/5cf63704122a5aff52b20c4e54e4a8a507f62799))

## [7.11.0](https://github.com/netlify/build/compare/build-info-v7.10.2...build-info-v7.11.0) (2023-11-08)


### Features

* autoinstall Angular v17 ([#5367](https://github.com/netlify/build/issues/5367)) ([6a75332](https://github.com/netlify/build/commit/6a753323fe0d777b370e058c6c41ca9f8842b538))

## [7.10.2](https://github.com/netlify/build/compare/build-info-v7.10.1...build-info-v7.10.2) (2023-10-24)


Expand Down
2 changes: 1 addition & 1 deletion packages/build-info/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@netlify/build-info",
"version": "7.10.2",
"version": "7.11.1",
"description": "Build info utility",
"type": "module",
"exports": {
Expand Down
29 changes: 26 additions & 3 deletions packages/build-info/src/frameworks/angular.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,36 @@ beforeEach((ctx) => {

test('should detect Angular', async ({ fs }) => {
const cwd = mockFileSystem({
'package.json': JSON.stringify({ dependencies: { '@angular/cli': '1.2.3' } }),
'angular.json': '',
'package.json': JSON.stringify({ dependencies: { '@angular/cli': '17.0.0' } }),
'angular.json': JSON.stringify({
projects: {
demo: {
architect: {
build: {
options: {
outputPath: 'dist/demo',
},
},
},
},
},
}),
})
const detected = await new Project(fs, cwd).detectFrameworks()
expect(detected?.[0].id).toBe('angular')
expect(detected?.[0].name).toBe('Angular')
expect(detected?.[0].build.command).toBe('ng build --prod')
expect(detected?.[0].build.directory).toBe('dist/')
expect(detected?.[0].build.directory).toBe(fs.join('dist', 'demo', 'browser'))
expect(detected?.[0].dev?.command).toBe('ng serve')
expect(detected?.[0].plugins).toEqual(['@netlify/angular-runtime'])
})

test('should only install plugin on v17+', async ({ fs }) => {
const cwd = mockFileSystem({
'package.json': JSON.stringify({ dependencies: { '@angular/cli': '16.0.0' } }),
'angular.json': '',
})
const detected = await new Project(fs, cwd).detectFrameworks()
expect(detected?.[0].build.directory).toBe('dist/')
expect(detected?.[0].plugins).toEqual([])
})
24 changes: 23 additions & 1 deletion packages/build-info/src/frameworks/angular.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { BaseFramework, Category, Framework } from './framework.js'
import { gte } from 'semver'

import { BaseFramework, Category, DetectedFramework, Framework } from './framework.js'

export class Angular extends BaseFramework implements Framework {
readonly id = 'angular'
Expand All @@ -23,4 +25,24 @@ export class Angular extends BaseFramework implements Framework {
light: '/logos/angular/default.svg',
dark: '/logos/angular/default.svg',
}

async detect(): Promise<DetectedFramework | undefined> {
await super.detect()

if (this.detected) {
if (this.version && gte(this.version, '17.0.0-rc')) {
this.plugins.push('@netlify/angular-runtime')
const angularJson = await this.project.fs.gracefullyReadFile('angular.json')
if (angularJson) {
const { projects, defaultProject } = JSON.parse(angularJson)
const project = projects[defaultProject ?? Object.keys(projects)[0]]
const outputPath = project?.architect?.build?.options?.outputPath
if (outputPath) {
this.build.directory = this.project.fs.join(outputPath, 'browser')
}
}
}
return this as DetectedFramework
}
}
}
22 changes: 22 additions & 0 deletions packages/build/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,28 @@
* dependencies
* @netlify/config bumped from ^20.8.0 to ^20.8.1

## [29.26.3](https://github.com/netlify/build/compare/build-v29.26.2...build-v29.26.3) (2023-11-09)


### Bug Fixes

* **deps:** update dependency @netlify/edge-bundler to v10 ([#5368](https://github.com/netlify/build/issues/5368)) ([4c3a944](https://github.com/netlify/build/commit/4c3a944b2b8b091130435b8edd787a187e05dafd))
* **deps:** update dependency @netlify/zip-it-and-ship-it to v9.26.1 ([#5376](https://github.com/netlify/build/issues/5376)) ([36e3808](https://github.com/netlify/build/commit/36e380864177a0b8e9d216308eed53c51efb8caa))


### Dependencies

* The following workspace dependencies were updated
* dependencies
* @netlify/functions-utils bumped from ^5.2.39 to ^5.2.40

## [29.26.2](https://github.com/netlify/build/compare/build-v29.26.1...build-v29.26.2) (2023-11-08)


### Bug Fixes

* **deps:** update dependency @netlify/plugins-list to ^6.72.0 ([#5372](https://github.com/netlify/build/issues/5372)) ([fede9ba](https://github.com/netlify/build/commit/fede9ba5779fa41159b9e064cb1798378b219f58))

## [29.26.1](https://github.com/netlify/build/compare/build-v29.26.0...build-v29.26.1) (2023-11-07)


Expand Down
10 changes: 5 additions & 5 deletions packages/build/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@netlify/build",
"version": "29.26.1",
"version": "29.26.3",
"description": "Netlify build module",
"type": "module",
"exports": "./lib/index.js",
Expand Down Expand Up @@ -68,13 +68,13 @@
"@honeycombio/opentelemetry-node": "^0.5.0",
"@netlify/cache-utils": "^5.1.5",
"@netlify/config": "^20.9.0",
"@netlify/edge-bundler": "9.5.0",
"@netlify/edge-bundler": "10.1.0",
"@netlify/framework-info": "^9.8.10",
"@netlify/functions-utils": "^5.2.39",
"@netlify/functions-utils": "^5.2.40",
"@netlify/git-utils": "^5.1.1",
"@netlify/plugins-list": "^6.71.0",
"@netlify/plugins-list": "^6.72.0",
"@netlify/run-utils": "^5.1.1",
"@netlify/zip-it-and-ship-it": "9.26.0",
"@netlify/zip-it-and-ship-it": "9.26.1",
"@opentelemetry/api": "^1.4.1",
"@opentelemetry/core": "^1.17.1",
"@sindresorhus/slugify": "^2.0.0",
Expand Down
7 changes: 7 additions & 0 deletions packages/functions-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [5.2.40](https://github.com/netlify/build/compare/functions-utils-v5.2.39...functions-utils-v5.2.40) (2023-11-09)


### Bug Fixes

* **deps:** update dependency @netlify/zip-it-and-ship-it to v9.26.1 ([#5376](https://github.com/netlify/build/issues/5376)) ([36e3808](https://github.com/netlify/build/commit/36e380864177a0b8e9d216308eed53c51efb8caa))

## [5.2.39](https://github.com/netlify/build/compare/functions-utils-v5.2.38...functions-utils-v5.2.39) (2023-11-07)


Expand Down
4 changes: 2 additions & 2 deletions packages/functions-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@netlify/functions-utils",
"version": "5.2.39",
"version": "5.2.40",
"description": "Utility for adding Functions files in Netlify Build",
"type": "module",
"exports": "./lib/main.js",
Expand Down Expand Up @@ -50,7 +50,7 @@
},
"license": "MIT",
"dependencies": {
"@netlify/zip-it-and-ship-it": "9.26.0",
"@netlify/zip-it-and-ship-it": "9.26.1",
"cpy": "^9.0.0",
"path-exists": "^5.0.0"
},
Expand Down

0 comments on commit 558c79e

Please sign in to comment.