@angular/fire 7.5.0 → 7.6.0-canary.7a2402a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/README.md +85 -70
  2. package/bundles/angular-fire.umd.js +1 -1
  3. package/bundles/angular-fire.umd.js.map +1 -1
  4. package/docs/analytics.md +67 -0
  5. package/docs/app-check.md +53 -0
  6. package/docs/auth.md +165 -0
  7. package/docs/{analytics → compat/analytics}/getting-started.md +2 -0
  8. package/docs/{auth → compat/auth}/getting-started.md +2 -0
  9. package/docs/{auth → compat/auth}/router-guards.md +2 -0
  10. package/docs/{emulators → compat/emulators}/emulators.md +2 -0
  11. package/docs/{firestore → compat/firestore}/collections.md +2 -0
  12. package/docs/{firestore → compat/firestore}/documents.md +2 -0
  13. package/docs/{firestore → compat/firestore}/offline-data.md +2 -0
  14. package/docs/{firestore → compat/firestore}/querying-collections.md +2 -0
  15. package/docs/{functions → compat/functions}/functions.md +2 -0
  16. package/docs/{messaging → compat/messaging}/messaging.md +2 -0
  17. package/docs/{performance → compat/performance}/getting-started.md +2 -0
  18. package/docs/{remote-config → compat/remote-config}/getting-started.md +2 -0
  19. package/docs/{rtdb → compat/rtdb}/lists.md +2 -0
  20. package/docs/{rtdb → compat/rtdb}/objects.md +2 -0
  21. package/docs/{rtdb → compat/rtdb}/querying-lists.md +2 -0
  22. package/docs/{storage → compat/storage}/storage.md +2 -0
  23. package/docs/compat.md +70 -0
  24. package/docs/database.md +175 -0
  25. package/docs/firestore.md +148 -0
  26. package/docs/functions.md +52 -0
  27. package/docs/images/analytics-illo_1x.png +0 -0
  28. package/docs/images/auth-illo_1x.png +0 -0
  29. package/docs/images/cloud-messaging-illo_1x.png +0 -0
  30. package/docs/images/database-illo_1x.png +0 -0
  31. package/docs/images/firestore-illo_1x.png +0 -0
  32. package/docs/images/functions-illo_1x.png +0 -0
  33. package/docs/images/hosting-illo_1x.png +0 -0
  34. package/docs/images/performance-illo_1x.png +0 -0
  35. package/docs/images/reCAPTCHA-logo@1x.png +0 -0
  36. package/docs/images/remote-config-illo_1x.png +0 -0
  37. package/docs/images/storage-illo_1x.png +0 -0
  38. package/docs/install-and-setup.md +38 -85
  39. package/docs/messaging.md +25 -0
  40. package/docs/performance.md +57 -0
  41. package/docs/remote-config.md +53 -0
  42. package/docs/storage.md +90 -0
  43. package/esm2015/core.js +1 -1
  44. package/fesm2015/angular-fire.js +1 -1
  45. package/fesm2015/angular-fire.js.map +1 -1
  46. package/package.json +8 -8
  47. package/schematics/deploy/actions.js +23 -14
  48. package/schematics/firebaseTools.js +4 -2
  49. package/schematics/setup/index.js +58 -29
  50. package/schematics/setup/prompts.js +18 -46
  51. package/schematics/utils.js +32 -28
  52. package/docs/ionic/authentication.md +0 -104
  53. package/docs/ionic/cli.md +0 -218
  54. package/docs/ionic/v2.md +0 -531
  55. package/docs/ionic/v3.md +0 -705
  56. package/schematics/setup/ssr.js +0 -100
  57. package/schematics/setup/static.js +0 -78
@@ -1,100 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setupUniversalDeployment = exports.generateFirebaseJson = void 0;
4
- const schematics_1 = require("@angular-devkit/schematics");
5
- const common_1 = require("../common");
6
- const versions_json_1 = require("../versions.json");
7
- const tasks_1 = require("@angular-devkit/schematics/tasks");
8
- const common_2 = require("../common");
9
- function generateHostingConfig(project, dist, functionName, projectType) {
10
- return {
11
- target: project,
12
- public: dist,
13
- ignore: ['**/.*'],
14
- headers: [{
15
- source: '*.[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f].+(css|js)',
16
- headers: [{
17
- key: 'Cache-Control',
18
- value: 'public,max-age=31536000,immutable',
19
- }]
20
- }, {
21
- source: '/@(ngsw-worker.js|ngsw.json)',
22
- headers: [{
23
- key: 'Cache-Control',
24
- value: 'no-cache',
25
- }]
26
- }],
27
- rewrites: [
28
- projectType === 1 ? {
29
- source: '**',
30
- function: functionName
31
- } : {
32
- source: '**',
33
- run: { serviceId: functionName }
34
- }
35
- ]
36
- };
37
- }
38
- function generateFunctionsConfig(source) {
39
- return {
40
- source
41
- };
42
- }
43
- function generateFirebaseJson(tree, path, project, dist, functionsOutput, functionName, projectType) {
44
- const firebaseJson = tree.exists(path)
45
- ? common_1.safeReadJSON(path, tree)
46
- : {};
47
- const newConfig = generateHostingConfig(project, dist, functionName, projectType);
48
- if (firebaseJson.hosting === undefined) {
49
- firebaseJson.hosting = [newConfig];
50
- }
51
- else if (Array.isArray(firebaseJson.hosting)) {
52
- const existingConfigIndex = firebaseJson.hosting.findIndex(config => config.target === newConfig.target);
53
- if (existingConfigIndex > -1) {
54
- firebaseJson.hosting.splice(existingConfigIndex, 1, newConfig);
55
- }
56
- else {
57
- firebaseJson.hosting.push(newConfig);
58
- }
59
- }
60
- else {
61
- firebaseJson.hosting = [firebaseJson.hosting, newConfig];
62
- }
63
- if (projectType === 1) {
64
- firebaseJson.functions = generateFunctionsConfig(functionsOutput);
65
- }
66
- common_1.overwriteIfExists(tree, path, common_1.stringifyFormatted(firebaseJson));
67
- }
68
- exports.generateFirebaseJson = generateFirebaseJson;
69
- const setupUniversalDeployment = (config) => {
70
- var _a, _b, _c, _d, _e, _f;
71
- const { tree, workspacePath, workspace, options } = config;
72
- const project = workspace.projects[options.project];
73
- if (!((_c = (_b = (_a = project.architect) === null || _a === void 0 ? void 0 : _a.build) === null || _b === void 0 ? void 0 : _b.options) === null || _c === void 0 ? void 0 : _c.outputPath)) {
74
- throw new schematics_1.SchematicsException(`Cannot read the output path (architect.build.options.outputPath) of the Angular project "${options.project}" in angular.json`);
75
- }
76
- if (!((_f = (_e = (_d = project.architect) === null || _d === void 0 ? void 0 : _d.server) === null || _e === void 0 ? void 0 : _e.options) === null || _f === void 0 ? void 0 : _f.outputPath)) {
77
- throw new schematics_1.SchematicsException(`Cannot read the output path (architect.server.options.outputPath) of the Angular project "${options.project}" in angular.json`);
78
- }
79
- const ssrDirectory = config.projectType === 1 ? 'functions' : 'run';
80
- const staticOutput = project.architect.build.options.outputPath;
81
- const functionsOutput = `dist/${options.project}/${ssrDirectory}`;
82
- const functionName = config.projectType === 2 ?
83
- `ssr-${options.project.replace('_', '-')}` :
84
- `ssr_${options.project}`;
85
- project.architect.deploy = {
86
- builder: '@angular/fire:deploy',
87
- options: Object.assign(Object.assign(Object.assign({ ssr: config.projectType === 2 ? 'cloud-run' : 'cloud-functions', prerender: options.prerender, firebaseProject: options.firebaseProject.projectId, firebaseHostingSite: common_2.shortSiteName(options.firebaseHostingSite), functionName, functionsNodeVersion: config.nodeVersion, region: 'us-central1', browserTarget: options.browserTarget }, (options.serverTarget ? { serverTarget: options.serverTarget } : {})), (options.prerenderTarget ? { prerenderTarget: options.prerenderTarget } : {})), { outputPath: functionsOutput })
88
- };
89
- tree.overwrite(workspacePath, JSON.stringify(workspace, null, 2));
90
- common_1.addDependencies(tree, Object.entries(versions_json_1.firebaseFunctionsDependencies).reduce((acc, [dep, deets]) => {
91
- deets.dev = true;
92
- acc[dep] = deets;
93
- return acc;
94
- }, {}), config.context);
95
- config.context.addTask(new tasks_1.NodePackageInstallTask());
96
- generateFirebaseJson(tree, 'firebase.json', options.project, staticOutput, functionsOutput, functionName, config.projectType);
97
- common_1.generateFirebaseRc(tree, '.firebaserc', options.firebaseProject.projectId, options.firebaseHostingSite, options.project);
98
- return tree;
99
- };
100
- exports.setupUniversalDeployment = setupUniversalDeployment;
@@ -1,78 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setupStaticDeployment = exports.generateFirebaseJson = void 0;
4
- const schematics_1 = require("@angular-devkit/schematics");
5
- const common_1 = require("../common");
6
- const common_2 = require("../common");
7
- function emptyFirebaseJson() {
8
- return {
9
- hosting: []
10
- };
11
- }
12
- function generateHostingConfig(project, dist) {
13
- return {
14
- target: project,
15
- public: dist,
16
- ignore: ['**/.*'],
17
- headers: [{
18
- source: '*.[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f].+(css|js)',
19
- headers: [{
20
- key: 'Cache-Control',
21
- value: 'public,max-age=31536000,immutable',
22
- }],
23
- }, {
24
- source: '/@(ngsw-worker.js|ngsw.json)',
25
- headers: [{
26
- key: 'Cache-Control',
27
- value: 'no-cache',
28
- }],
29
- }],
30
- rewrites: [
31
- {
32
- source: '**',
33
- destination: '/index.html',
34
- }
35
- ]
36
- };
37
- }
38
- function generateFirebaseJson(tree, path, project, dist) {
39
- const firebaseJson = tree.exists(path)
40
- ? common_1.safeReadJSON(path, tree)
41
- : emptyFirebaseJson();
42
- const newConfig = generateHostingConfig(project, dist);
43
- if (firebaseJson.hosting === undefined) {
44
- firebaseJson.hosting = newConfig;
45
- }
46
- else if (Array.isArray(firebaseJson.hosting)) {
47
- const targetIndex = firebaseJson.hosting.findIndex(it => it.target === newConfig.target);
48
- if (targetIndex > -1) {
49
- firebaseJson.hosting[targetIndex] = newConfig;
50
- }
51
- else {
52
- firebaseJson.hosting.push(newConfig);
53
- }
54
- }
55
- else {
56
- firebaseJson.hosting = [firebaseJson.hosting, newConfig];
57
- }
58
- common_1.overwriteIfExists(tree, path, common_1.stringifyFormatted(firebaseJson));
59
- }
60
- exports.generateFirebaseJson = generateFirebaseJson;
61
- const setupStaticDeployment = (config) => {
62
- var _a, _b, _c;
63
- const { tree, workspacePath, workspace, options } = config;
64
- const project = workspace.projects[options.project];
65
- if (!((_c = (_b = (_a = project.architect) === null || _a === void 0 ? void 0 : _a.build) === null || _b === void 0 ? void 0 : _b.options) === null || _c === void 0 ? void 0 : _c.outputPath)) {
66
- throw new schematics_1.SchematicsException(`Cannot read the output path (architect.build.options.outputPath) of the Angular project "${options.project}" in angular.json`);
67
- }
68
- const outputPath = project.architect.build.options.outputPath;
69
- project.architect.deploy = {
70
- builder: '@angular/fire:deploy',
71
- options: Object.assign(Object.assign({ prerender: options.prerender, ssr: false, browserTarget: options.browserTarget, firebaseProject: options.firebaseProject.projectId, firebaseHostingSite: common_2.shortSiteName(options.firebaseHostingSite) }, (options.serverTarget ? { serverTarget: options.serverTarget } : {})), (options.prerenderTarget ? { prerenderTarget: options.prerenderTarget } : {}))
72
- };
73
- tree.overwrite(workspacePath, JSON.stringify(workspace, null, 2));
74
- generateFirebaseJson(tree, 'firebase.json', options.project, outputPath);
75
- common_1.generateFirebaseRc(tree, '.firebaserc', options.firebaseProject.projectId, options.firebaseHostingSite, options.project);
76
- return tree;
77
- };
78
- exports.setupStaticDeployment = setupStaticDeployment;