Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@

A detailed changelog is available in the [releases](https://github.com/angular-schule/angular-cli-ghpages/releases) section.

`angular-cli-ghpages` v3 supports Angular 18 to 21.
For previous versions of Angular, use v1 or v2.
`angular-cli-ghpages` supports Angular 20 to 22.
For previous versions of Angular, use an older release of this package.

## ⚠️ Prerequisites <a name="prerequisites"></a>

This command has the following prerequisites:

- Git 1.9 or higher (execute `git --version` to check your version)
- Angular project created via [Angular CLI](https://github.com/angular/angular-cli) v18 or greater
- Angular project created via [Angular CLI](https://github.com/angular/angular-cli) v20 or greater
- Older Angular projects can still use a v1.x version or use the standalone program. See the documentation at [README_standalone](https://github.com/angular-schule/angular-cli-ghpages/blob/master/docs/README_standalone.md).

## 🚀 Quick Start <a name="quickstart"></a>
Expand Down
2 changes: 1 addition & 1 deletion src/deploy/actions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ describe('Deploy Angular apps', () => {
expect(dir).toBe(`dist/${PROJECT}/browser`);
});

it('appends /browser when outputPath is string (Angular 18-19)', async () => {
it('appends /browser when outputPath is a string', async () => {
const dir = await captureDir('dist/my-app');
expect(dir).toBe('dist/my-app/browser');
});
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export type AngularOutputPath = string | AngularOutputPathObject;
* Validates:
* - value is an object (not null, not array)
* - base property exists and is a non-empty string
* - browser property, if present, is a string (can be empty for Angular 19+ SPA mode)
* - browser property, if present, is a string (empty string allowed for SPA mode)
*/
export function isOutputPathObject(value: unknown): value is AngularOutputPathObject {
if (!value || typeof value !== 'object' || Array.isArray(value)) {
Expand Down
2 changes: 1 addition & 1 deletion src/ng-add.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ describe('ng-add', () => {
});
});

describe('Angular 17+ outputPath formats', () => {
describe('outputPath formats', () => {
it('should accept Angular 20+ projects without outputPath (uses default)', async () => {
const tree = Tree.empty();
tree.create(
Expand Down
8 changes: 2 additions & 6 deletions src/ng-add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,10 @@ export const ngAdd = (options: NgAddOptions) => async (
);
}

// outputPath validation:
// - Angular 20+: outputPath is omitted (uses default dist/<project-name>)
// - Angular 17-19: object format { base: "dist/app", browser: "", ... }
// - Earlier versions: string format "dist/app"
// See: https://github.com/angular/angular-cli/pull/26675
// outputPath validation: accept undefined (Angular 20+ default), string, or { base, ... } object.
const outputPath = buildTarget.options?.outputPath;
const hasValidOutputPath =
outputPath === undefined || // Angular 20+ uses sensible defaults
outputPath === undefined ||
typeof outputPath === 'string' ||
(typeof outputPath === 'object' && outputPath !== null && 'base' in outputPath);

Expand Down
Loading