-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
55 changed files
with
205 additions
and
1,890 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 0 additions & 93 deletions
93
packages/angular/src/lib/bootstrap/add-provider-to-bootstrap-application-fn.spec.ts
This file was deleted.
Oops, something went wrong.
30 changes: 0 additions & 30 deletions
30
packages/angular/src/lib/bootstrap/add-provider-to-bootstrap-application-fn.ts
This file was deleted.
Oops, something went wrong.
23 changes: 13 additions & 10 deletions
23
packages/angular/src/lib/bootstrap/get-bootstrap-application-fn.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
import type { CallExpression } from 'ts-morph'; | ||
import { Node, SyntaxKind } from 'ts-morph'; | ||
|
||
import { getImports } from '@mutates/core'; | ||
import { getImportRefs, getImports, getNamedImports } from '@mutates/core'; | ||
|
||
export function getBootstrapApplicationFn(mainFilePath: string): CallExpression | undefined { | ||
const [bootstrapApplicationImport] = getImports(mainFilePath, { | ||
moduleSpecifier: '@angular/platform-browser', | ||
}); | ||
const [namedImport] = getNamedImports( | ||
getImports(mainFilePath, { | ||
moduleSpecifier: '@angular/platform-browser', | ||
}), | ||
{ | ||
name: 'bootstrapApplication', | ||
}, | ||
); | ||
|
||
const namedImport = bootstrapApplicationImport | ||
?.getNamedImports() | ||
.find((imp) => imp.getName() === 'bootstrapApplication'); | ||
if (!namedImport) { | ||
return; | ||
} | ||
|
||
return namedImport | ||
?.getNameNode() | ||
.findReferencesAsNodes() | ||
return getImportRefs(namedImport) | ||
.find((ref) => Node.isCallExpression(ref.getParent())) | ||
?.getParentIfKind(SyntaxKind.CallExpression); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
packages/angular/src/lib/bootstrap/get-bootstrap-module-fn.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import type { CallExpression } from 'ts-morph'; | ||
import { Node, SyntaxKind } from 'ts-morph'; | ||
|
||
import { getImportRefs, getImports, getNamedImports } from '@mutates/core'; | ||
|
||
export function getBootstrapModuleFn(mainFilePath: string): CallExpression | undefined { | ||
const namedImport = getNamedImports( | ||
getImports(mainFilePath, { | ||
moduleSpecifier: '@angular/platform-browser-dynamic', | ||
}), | ||
{ | ||
name: 'platformBrowserDynamic', | ||
}, | ||
); | ||
|
||
return getImportRefs(namedImport) | ||
.find((ref) => Node.isCallExpression(ref.getParent())) | ||
?.getParentIfKind(SyntaxKind.CallExpression) | ||
?.getParentIfKind(SyntaxKind.PropertyAccessExpression) | ||
?.getParentIfKind(SyntaxKind.CallExpression); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
export * from './add-provider-to-bootstrap-application-fn'; | ||
export * from './get-bootstrap-application-fn'; | ||
export * from './get-bootstrap-fn'; | ||
export * from './get-bootstrap-module-fn'; |
121 changes: 0 additions & 121 deletions
121
packages/angular/src/lib/component/add-import-to-component.spec.ts
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
packages/angular/src/lib/component/add-import-to-component.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.