Skip to content

Commit 714bc22

Browse files
committed
refactor(@schematics/angular): remove private /components API
Last usages of this API has been removed in angular/components#28424
1 parent 07d73b6 commit 714bc22

File tree

7 files changed

+35
-1299
lines changed

7 files changed

+35
-1299
lines changed

packages/schematics/angular/app-shell/index.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
noop,
1616
schematic,
1717
} from '@angular-devkit/schematics';
18-
import { findBootstrapApplicationCall } from '../private/standalone';
1918
import * as ts from '../third_party/github.com/Microsoft/TypeScript/lib/typescript';
2019
import {
2120
addImportToModule,
@@ -29,7 +28,8 @@ import {
2928
} from '../utility/ast-utils';
3029
import { applyToUpdateRecorder } from '../utility/change';
3130
import { getAppModulePath, isStandaloneApp } from '../utility/ng-ast-utils';
32-
import { getMainFilePath } from '../utility/standalone/util';
31+
import { findAppConfig } from '../utility/standalone/app_config';
32+
import { findBootstrapApplicationCall, getMainFilePath } from '../utility/standalone/util';
3333
import { getWorkspace, updateWorkspace } from '../utility/workspace';
3434
import { Builders } from '../utility/workspace-models';
3535
import { Schema as AppShellOptions } from './schema';
@@ -89,18 +89,16 @@ function getComponentTemplate(host: Tree, compPath: string, tmplInfo: TemplateIn
8989
}
9090

9191
function getBootstrapComponentPath(host: Tree, mainPath: string): string {
92-
const mainSource = getSourceFile(host, mainPath);
93-
const bootstrapAppCall = findBootstrapApplicationCall(mainSource);
94-
9592
let bootstrappingFilePath: string;
9693
let bootstrappingSource: ts.SourceFile;
9794
let componentName: string;
9895

99-
if (bootstrapAppCall) {
96+
if (isStandaloneApp(host, mainPath)) {
10097
// Standalone Application
101-
componentName = bootstrapAppCall.arguments[0].getText();
98+
const bootstrapCall = findBootstrapApplicationCall(host, mainPath);
99+
componentName = bootstrapCall.arguments[0].getText();
102100
bootstrappingFilePath = mainPath;
103-
bootstrappingSource = mainSource;
101+
bootstrappingSource = getSourceFile(host, mainPath);
104102
} else {
105103
// NgModule Application
106104
const modulePath = getAppModulePath(host, mainPath);

packages/schematics/angular/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
"./utility": "./utility/index.js",
1414
"./utility/*": "./utility/*.js",
1515
"./migrations/migration-collection.json": "./migrations/migration-collection.json",
16-
"./*": "./*.js",
17-
"./private/components": "./private/components.js"
16+
"./*": "./*.js"
1817
},
1918
"schematics": "./collection.json",
2019
"dependencies": {

packages/schematics/angular/private/components.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)