Skip to content

Commit 8213432

Browse files
committed
chore: remove all browserTarget references from codebase
1 parent 2e29f89 commit 8213432

File tree

5 files changed

+7
-130
lines changed

5 files changed

+7
-130
lines changed

CLAUDE.md

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -127,21 +127,13 @@ actions.ts (deploy function)
127127

128128
### Build Target Resolution
129129

130-
**Internal Implementation Precedence (what the code actually does):**
130+
**Precedence:**
131131
1. `prerenderTarget` - For SSG/prerendering builds (if specified, overrides all others)
132-
2. `browserTarget` - **DEPRECATED** legacy option (if specified, takes precedence over buildTarget for backward compatibility)
133-
3. `buildTarget` - Standard build target (if specified)
134-
4. Default - `${project}:build:production`
135-
136-
**User-Facing Precedence (what we tell users in README.md):**
137-
1. `prerenderTarget` (if specified) — highest priority
138-
2. `buildTarget`
139-
3. Default: `${project}:build:production` if none specified
140-
141-
**Note:** `browserTarget` is deliberately HIDDEN from user-facing documentation per deprecation policy, even though it still works internally for backward compatibility.
132+
2. `buildTarget` - Standard build target (if specified)
133+
3. Default - `${project}:build:production`
142134

143135
**Implementation details:**
144-
- Static build target: `browserTarget || buildTarget || default` (see `src/deploy/builder.ts`)
136+
- Static build target: `buildTarget || default` (see `src/deploy/builder.ts`)
145137
- Final target: `prerenderTarget || staticBuildTarget` (see `src/deploy/builder.ts`)
146138

147139
Output directory resolution:
@@ -191,20 +183,10 @@ The engine appends CI metadata to commit messages when running on:
191183
## Deprecated Options (Maintainers Only)
192184

193185
**Current deprecated options:**
194-
- `browserTarget` - Replaced by `buildTarget`, still works for compatibility
195186
- `noSilent` - Ignored with warning
196187

197-
**Policy:** DO NOT promote deprecated options in user-facing docs (README.md). Hide `browserTarget` from precedence explanations and configuration examples.
198-
199-
**Schema deprecation format:**
200-
```json
201-
"browserTarget": {
202-
"type": "string",
203-
"deprecated": true,
204-
"x-deprecated": "Use buildTarget instead. Kept for backwards compatibility.",
205-
"description": "DEPRECATED: Use buildTarget instead. Legacy alias kept for backwards compatibility only."
206-
}
207-
```
188+
**Removed options (v2.1+):**
189+
- `browserTarget` - Removed entirely, use `buildTarget` instead
208190

209191
## Testing
210192

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ This can be very useful because it outputs what would happen without doing anyth
428428

429429
To avoid all these command-line cmd options, you can write down your configuration in the `angular.json` file in the `options` attribute of your deploy project's architect. Just change the kebab-case to lower camel case. Commonly used options in lower camel case (see `src/deploy/schema.json` for the complete list including deprecated options):
430430

431-
<!-- deprecated options (browserTarget, noSilent) hidden per deprecation policy -->
431+
<!-- deprecated options (noSilent) hidden per deprecation policy -->
432432
- baseHref
433433
- buildTarget
434434
- prerenderTarget

docs/README_standalone.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ npx angular-cli-ghpages --dir=www
5656
The following parameters are **only available** when using `ng deploy` (Angular Builder integration) and are **not supported** by the standalone CLI:
5757

5858
- `--build-target` / `buildTarget`
59-
- `--browser-target` / `browserTarget`
6059
- `--prerender-target` / `prerenderTarget`
6160
- `--no-build` / `noBuild`
6261
- `--base-href` / `baseHref` (only as a build option; use `ng build --base-href` instead)

src/deploy/schema.d.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ export interface Schema {
1717
* A named build target, as specified in the `configurations` section of angular.json. Each named target is accompanied by a configuration of option defaults for that target. This is equivalent to calling the command `ng build --configuration=XXX`.
1818
*/
1919
buildTarget?: string;
20-
/**
21-
* @deprecated
22-
* DEPRECATED: Use buildTarget instead. Legacy alias kept for backwards compatibility only.
23-
*/
24-
browserTarget?: string;
2520
/**
2621
* Architect target for prerendering/SSG. Takes precedence over buildTarget when specified. Requires a prerender target configured in angular.json.
2722
*/

src/parameter-tests/build-target.spec.ts

Lines changed: 0 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { Schema } from '../deploy/schema';
99
*
1010
* Tests for Angular Builder-specific target parameters:
1111
* - buildTarget: Standard build target
12-
* - browserTarget: Legacy/alternative build target
1312
* - prerenderTarget: SSG/prerender build target
1413
* - noBuild: Skip build process
1514
*
@@ -109,65 +108,6 @@ describe('Build Target Resolution', () => {
109108
});
110109
});
111110

112-
describe('browserTarget parameter (legacy)', () => {
113-
it('should use browserTarget when specified', async () => {
114-
const browserTarget = `${PROJECT}:build:staging`;
115-
const expectedBuildTarget: BuildTarget = { name: browserTarget };
116-
const options: Schema = { browserTarget, noBuild: false };
117-
118-
await deploy(mockEngine, context, expectedBuildTarget, options);
119-
120-
expect(scheduleTargetSpy).toHaveBeenCalledTimes(1);
121-
expect(scheduleTargetSpy).toHaveBeenCalledWith(
122-
{
123-
project: PROJECT,
124-
target: 'build',
125-
configuration: 'staging'
126-
},
127-
{}
128-
);
129-
});
130-
131-
it('should parse browserTarget with project:target:configuration format', async () => {
132-
const browserTarget = 'legacy-app:build:development';
133-
const expectedBuildTarget: BuildTarget = { name: browserTarget };
134-
const options: Schema = { browserTarget, noBuild: false };
135-
136-
await deploy(mockEngine, context, expectedBuildTarget, options);
137-
138-
expect(scheduleTargetSpy).toHaveBeenCalledWith(
139-
{
140-
project: 'legacy-app',
141-
target: 'build',
142-
configuration: 'development'
143-
},
144-
{}
145-
);
146-
});
147-
});
148-
149-
describe('buildTarget vs browserTarget precedence', () => {
150-
it('should prefer browserTarget over buildTarget when both specified', async () => {
151-
// Note: In builder.ts line 25, browserTarget comes BEFORE buildTarget in the OR chain
152-
const browserTarget = `${PROJECT}:build:staging`;
153-
const buildTarget = `${PROJECT}:build:production`;
154-
const expectedBuildTarget: BuildTarget = { name: browserTarget };
155-
const options: Schema = { browserTarget, buildTarget, noBuild: false };
156-
157-
await deploy(mockEngine, context, expectedBuildTarget, options);
158-
159-
// Should use browserTarget (comes first in OR chain)
160-
expect(scheduleTargetSpy).toHaveBeenCalledWith(
161-
{
162-
project: PROJECT,
163-
target: 'build',
164-
configuration: 'staging'
165-
},
166-
{}
167-
);
168-
});
169-
});
170-
171111
describe('prerenderTarget parameter', () => {
172112
it('should use prerenderTarget for SSG builds', async () => {
173113
const prerenderTarget = `${PROJECT}:prerender:production`;
@@ -224,45 +164,6 @@ describe('Build Target Resolution', () => {
224164
);
225165
});
226166

227-
it('should prefer prerenderTarget over browserTarget when both specified', async () => {
228-
const prerenderTarget = `${PROJECT}:prerender:production`;
229-
const browserTarget = `${PROJECT}:build:staging`;
230-
const expectedPrerenderTarget: BuildTarget = { name: prerenderTarget };
231-
const options: Schema = { prerenderTarget, browserTarget, noBuild: false };
232-
233-
await deploy(mockEngine, context, expectedPrerenderTarget, options);
234-
235-
// Should use prerenderTarget (highest precedence)
236-
expect(scheduleTargetSpy).toHaveBeenCalledWith(
237-
{
238-
project: PROJECT,
239-
target: 'prerender',
240-
configuration: 'production'
241-
},
242-
{}
243-
);
244-
});
245-
246-
it('should handle all three target types specified simultaneously', async () => {
247-
// Precedence: prerenderTarget > browserTarget > buildTarget > default
248-
const prerenderTarget = `${PROJECT}:prerender:production`;
249-
const browserTarget = `${PROJECT}:build:staging`;
250-
const buildTarget = `${PROJECT}:build:development`;
251-
const expectedPrerenderTarget: BuildTarget = { name: prerenderTarget };
252-
const options: Schema = { prerenderTarget, browserTarget, buildTarget, noBuild: false };
253-
254-
await deploy(mockEngine, context, expectedPrerenderTarget, options);
255-
256-
// Should use prerenderTarget (highest priority)
257-
expect(scheduleTargetSpy).toHaveBeenCalledWith(
258-
{
259-
project: PROJECT,
260-
target: 'prerender',
261-
configuration: 'production'
262-
},
263-
{}
264-
);
265-
});
266167
});
267168

268169
describe('noBuild parameter', () => {

0 commit comments

Comments
 (0)