diff --git a/package.json b/package.json index 77a8856b5..6842945c7 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,8 @@ "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1", "build:wrapper": "npm i --prefix wrapper && VERSION=5.1.2 npm run --prefix wrapper build" }, + "schematics": "./dist/packages-dist/collection.json", + "builders": "./dist/packages-dist/builders.json", "keywords": [ "angular", "firebase", diff --git a/src/core/collection.json b/src/core/collection.json index 8a4fc0ae0..1f16aac35 100644 --- a/src/core/collection.json +++ b/src/core/collection.json @@ -3,7 +3,7 @@ "schematics": { "ng-add": { "description": "Add firebase deploy schematic", - "factory": "./schematics/ng-add/index#ngDeploy" + "factory": "./schematics/index#ngDeploy" } } - } \ No newline at end of file + } diff --git a/src/schematics/index.ts b/src/schematics/index.ts index 02ea5207a..4d99e5e82 100644 --- a/src/schematics/index.ts +++ b/src/schematics/index.ts @@ -1,17 +1,17 @@ import { Tree } from '@angular-devkit/schematics'; import { from } from 'rxjs'; -import { map } from 'rxjs/operators'; +import { map, switchMap } from 'rxjs/operators'; import { Project } from './interfaces'; import { ngAdd } from './ng-add'; import { listProjects, projectPrompt } from './utils'; interface DeployOptions { - project: string; + project: string; } // You don't have to export the function as default. You can also have more than one rule factory // per file. export const ngDeploy = ({project}: DeployOptions) => (host: Tree) => from(listProjects()).pipe( - map((projects: Project[]) => projectPrompt(projects)), - map(({firebaseProject}: any) => ngAdd(host, {firebaseProject, project})) -) \ No newline at end of file + switchMap((projects: Project[]) => projectPrompt(projects)), + map(({firebaseProject}: any) => ngAdd(host, {firebaseProject, project})) +); diff --git a/src/schematics/ng-add.spec.ts b/src/schematics/ng-add.spec.ts index e69de29bb..c4cafd24a 100644 --- a/src/schematics/ng-add.spec.ts +++ b/src/schematics/ng-add.spec.ts @@ -0,0 +1,7 @@ +import 'jasmine'; + +describe('ng add', () => { + it('adds', () => { + expect(1).toBe(1); + }); +}); diff --git a/src/schematics/tsconfig.json b/src/schematics/tsconfig.json index f59d53a86..0ae90cd85 100644 --- a/src/schematics/tsconfig.json +++ b/src/schematics/tsconfig.json @@ -20,5 +20,5 @@ "target": "es6", "types": [ "node"] }, - "include": ["*"] -} \ No newline at end of file + "include": ["**/*.ts"] +}