Skip to content

Commit 32f57c2

Browse files
committed
Expose the schematic in the public-api
1 parent 6fb0f6d commit 32f57c2

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

sample/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"@angular/common": "^12.0.0",
1818
"@angular/compiler": "^12.0.0",
1919
"@angular/core": "^12.0.0",
20-
"@angular/fire": "6.0.0",
20+
"@angular/fire": "7.0.0-canary.6fb0f6d",
2121
"@angular/forms": "^12.0.0",
2222
"@angular/platform-browser": "^12.0.0",
2323
"@angular/platform-browser-dynamic": "^12.0.0",
@@ -56,4 +56,4 @@
5656
"resolutions": {
5757
"webpack": "^5.35.0"
5858
}
59-
}
59+
}

sample/yarn.lock

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,12 @@
216216
dependencies:
217217
tslib "^2.2.0"
218218

219-
"@angular/[email protected]":
220-
version "6.0.0"
221-
resolved "https://registry.yarnpkg.com/@angular/fire/-/fire-6.0.0.tgz#c1dbae9e78ed74af951fb7222108c444300a4d15"
222-
integrity sha512-zWhaJaZPtfJKiNSb1I3WqqvopW0fN3S61w4PjPdsm5WME+9M9alP0zpRVclpbCU26LpBSLhrRrSLyn3ROlAOIw==
219+
"@angular/[email protected]":
220+
version "7.0.0-canary.6fb0f6d"
221+
resolved "https://registry.yarnpkg.com/@angular/fire/-/fire-7.0.0-canary.6fb0f6d.tgz#04d8871d84e5d4a9ddda39640c153709f62e4b76"
222+
integrity sha512-X4V6VY5wKIQSig65OWDF6TCUWHs2/gcSz4jOmCz2wYLBob4RA0K4OWnvApMpbEntoh0TuTWWlqZgYFQ26t18Rw==
223+
dependencies:
224+
tslib "^2.0.0"
223225

224226
"@angular/forms@^12.0.0":
225227
version "12.1.3"

src/schematics/migration.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"migration-v7": {
55
"version": "7.0.0",
66
"description": "Update @angular/fire to v7",
7-
"factory": "./update/v7/index#ngUpdate"
7+
"factory": "./public-api#ngUpdateV7"
88
},
99
"ng-post-upgate": {
1010
"description": "Print out results after ng-update",

src/schematics/public_api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ export * from './ng-add';
22
export * from './deploy/actions';
33
export * from './deploy/builder';
44
export * from './ng-update';
5+
export { ngUpdate as ngUpdateV7 } from './update/v7';

src/schematics/update/v7/index.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Rule, SchematicContext, SchematicsException, Tree } from '@angular-devkit/schematics';
2-
import { overwriteIfExists, safeReadJSON, stringifyFormatted } from 'src/schematics/ng-add-common';
3-
2+
import { overwriteIfExists, safeReadJSON, stringifyFormatted } from '../../ng-add-common';
43
import { default as defaultDependencies, firebaseFunctions } from '../../versions.json';
54

65
export const ngUpdate = (): Rule => (
@@ -25,9 +24,9 @@ export const ngUpdate = (): Rule => (
2524
// TODO test if it's a SSR project in the JSON
2625
Object.keys(firebaseFunctions).forEach(depName => {
2726
const dep = firebaseFunctions[depName];
28-
if (dep.dev) {
27+
if (dep.dev && packageJson.devDependencies[depName]) {
2928
packageJson.devDependencies[depName] = dep.version;
30-
} else {
29+
} else if (packageJson.dependencies[depName]) {
3130
packageJson.dependencies[depName] = dep.version;
3231
}
3332
});

0 commit comments

Comments
 (0)