Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/core/collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"schematics": {
"ng-add": {
"description": "Add firebase deploy schematic",
"factory": "./schematics/ng-add/index#ngDeploy"
"factory": "./schematics/index#ngDeploy"
}
}
}
}
10 changes: 5 additions & 5 deletions src/schematics/index.ts
Original file line number Diff line number Diff line change
@@ -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}))
)
switchMap((projects: Project[]) => projectPrompt(projects)),
map(({firebaseProject}: any) => ngAdd(host, {firebaseProject, project}))
);
7 changes: 7 additions & 0 deletions src/schematics/ng-add.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import 'jasmine';

describe('ng add', () => {
it('adds', () => {
expect(1).toBe(1);
});
});
4 changes: 2 additions & 2 deletions src/schematics/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
"target": "es6",
"types": [ "node"]
},
"include": ["*"]
}
"include": ["**/*.ts"]
}