Skip to content

Commit dfc052a

Browse files
crisbetoalan-agius4
authored andcommitted
refactor(@schematics/angular): deprecate private standalone utilities
Deprecates the standalone utilities that were added specifically for the Components project, but ended up being used externally in favor of the newly-introduced rules.
1 parent b14b959 commit dfc052a

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

packages/schematics/angular/private/standalone.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ interface ResolvedAppConfig {
2626
* @param tree File tree of the project.
2727
* @param filePath Path of the file in which to check.
2828
* @param className Class name of the module to search for.
29+
* @deprecated Private utility that will be removed. Use `addRootImport` or `addRootProvider` from
30+
* `@schematics/angular/utility` instead.
2931
*/
3032
export function importsProvidersFrom(tree: Tree, filePath: string, className: string): boolean {
3133
const sourceFile = createSourceFile(tree, filePath);
@@ -43,6 +45,8 @@ export function importsProvidersFrom(tree: Tree, filePath: string, className: st
4345
* @param tree File tree of the project.
4446
* @param filePath Path of the file in which to check.
4547
* @param functionName Name of the function to search for.
48+
* @deprecated Private utility that will be removed. Use `addRootImport` or `addRootProvider` from
49+
* `@schematics/angular/utility` instead.
4650
*/
4751
export function callsProvidersFunction(
4852
tree: Tree,
@@ -68,6 +72,8 @@ export function callsProvidersFunction(
6872
* @param filePath Path to the file that should be updated.
6973
* @param moduleName Name of the module that should be imported.
7074
* @param modulePath Path from which to import the module.
75+
* @deprecated Private utility that will be removed. Use `addRootImport` or `addRootProvider` from
76+
* `@schematics/angular/utility` instead.
7177
*/
7278
export function addModuleImportToStandaloneBootstrap(
7379
tree: Tree,
@@ -164,6 +170,8 @@ export function addModuleImportToStandaloneBootstrap(
164170
* @param importPath Path from which to import the function.
165171
* @param args Arguments to use when calling the function.
166172
* @returns The file path that the provider was added to.
173+
* @deprecated Private utility that will be removed. Use `addRootImport` or `addRootProvider` from
174+
* `@schematics/angular/utility` instead.
167175
*/
168176
export function addFunctionalProvidersToStandaloneBootstrap(
169177
tree: Tree,
@@ -240,7 +248,11 @@ export function addFunctionalProvidersToStandaloneBootstrap(
240248
return configFilePath;
241249
}
242250

243-
/** Finds the call to `bootstrapApplication` within a file. */
251+
/**
252+
* Finds the call to `bootstrapApplication` within a file.
253+
* @deprecated Private utility that will be removed. Use `addRootImport` or `addRootProvider` from
254+
* `@schematics/angular/utility` instead.
255+
*/
244256
export function findBootstrapApplicationCall(sourceFile: ts.SourceFile): ts.CallExpression | null {
245257
const localName = findImportLocalName(
246258
sourceFile,

0 commit comments

Comments
 (0)