-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
Co-authored-by: Tomek Sułkowski <sulco@users.noreply.github.com>
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { chain, Rule, SchematicContext, TaskId, Tree } from '@angular-devkit/schematics'; | ||
import { DeployOptions } from '../interfaces'; | ||
import { addDependencies } from '../common'; | ||
import { peerDependencies } from '../versions.json'; | ||
import { NodePackageInstallTask, RunSchematicTask } from '@angular-devkit/schematics/tasks'; | ||
|
||
const addFirebaseHostingDependencies = () => (tree: Tree, context: SchematicContext) => { | ||
addDependencies( | ||
tree, | ||
peerDependencies, | ||
context | ||
); | ||
return tree; | ||
}; | ||
|
||
let npmInstallTaskId: TaskId; | ||
|
||
const npmInstall = () => (tree: Tree, context: SchematicContext) => { | ||
npmInstallTaskId = context.addTask(new NodePackageInstallTask()); | ||
return tree; | ||
}; | ||
|
||
const runSetup = (options: DeployOptions) => (tree: Tree, context: SchematicContext) => { | ||
context.addTask(new RunSchematicTask('ng-add-setup-project', options), [npmInstallTaskId]); | ||
return tree; | ||
}; | ||
|
||
export const ngAdd = (options: DeployOptions): Rule => { | ||
return chain([ | ||
addFirebaseHostingDependencies(), | ||
npmInstall(), | ||
runSetup(options), | ||
]); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema", | ||
"$id": "angular-fire-ng-add", | ||
"title": "AngularFire ng-add", | ||
"type": "object", | ||
"properties": { | ||
"project": { | ||
"type": "string", | ||
"description": "The name of the project.", | ||
"$default": { | ||
"$source": "projectName" | ||
} | ||
} | ||
}, | ||
"required": [] | ||
} |