MCPcopy
hub / github.com/angular/angularfire / setupProject

Function setupProject

src/schematics/setup/index.ts:31–47  ·  view source on GitHub ↗
(tree: Tree, context: SchematicContext, features: FEATURES[], config: SetupConfig)

Source from the content-addressed store, hash-verified

29
30export const setupProject =
31 (tree: Tree, context: SchematicContext, features: FEATURES[], config: SetupConfig) => {
32 const { projectName } = getProject(config, tree);
33
34 addIgnoreFiles(tree);
35
36 if (features.length) {
37 return chain([
38 addRootProvider(projectName, ({code, external}) => {
39 external('initializeApp', '@angular/fire/app');
40 return code`${external('provideFirebaseApp', '@angular/fire/app')}(() => initializeApp(${
41 config.sdkConfig ? `{ ${Object.entries(config.sdkConfig).map(([k, v]) => `${k}: ${JSON.stringify(v)}`).join(", ")} }` : ""
42 }))`;
43 }),
44 ...featureToRules(features, projectName, config.dataConnectConfig),
45 ]);
46 }
47};
48
49export const ngAddSetupProject = (
50 options: DeployOptions

Callers 1

ngAddSetupProjectFunction · 0.85

Calls 3

getProjectFunction · 0.90
addIgnoreFilesFunction · 0.90
featureToRulesFunction · 0.90

Tested by

no test coverage detected