@simondotm/nx-firebase 1.1.0-beta.0 → 2.0.0-beta.0

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 (126) hide show
  1. package/README.md +10 -10
  2. package/executors.json +0 -8
  3. package/generators.json +11 -0
  4. package/package.json +7 -4
  5. package/src/generators/application/application.d.ts +3 -3
  6. package/src/generators/application/application.js +119 -19
  7. package/src/generators/application/application.js.map +1 -1
  8. package/src/generators/application/files/readme.md__tmpl__ +12 -9
  9. package/src/generators/application/files_firebase/firebase.json__tmpl__ +6 -13
  10. package/src/generators/application/files_workspace/{firebase.__name__.json__tmpl__ → firebase.__projectName__.json__tmpl__} +6 -13
  11. package/src/generators/application/lib/create-files.js +10 -25
  12. package/src/generators/application/lib/create-files.js.map +1 -1
  13. package/src/generators/application/lib/index.d.ts +0 -3
  14. package/src/generators/application/lib/index.js +0 -3
  15. package/src/generators/application/lib/index.js.map +1 -1
  16. package/src/generators/application/schema.d.ts +3 -11
  17. package/src/generators/application/schema.json +0 -41
  18. package/src/generators/function/files/package.json__tmpl__ +19 -0
  19. package/src/generators/function/files/readme.md__tmpl__ +31 -0
  20. package/src/generators/function/function.d.ts +14 -0
  21. package/src/generators/function/function.js +77 -0
  22. package/src/generators/function/function.js.map +1 -0
  23. package/src/generators/function/lib/add-function.d.ts +3 -0
  24. package/src/generators/function/lib/add-function.js +25 -0
  25. package/src/generators/function/lib/add-function.js.map +1 -0
  26. package/src/generators/function/lib/create-files.d.ts +9 -0
  27. package/src/generators/function/lib/create-files.js +37 -0
  28. package/src/generators/function/lib/create-files.js.map +1 -0
  29. package/src/generators/{application → function}/lib/delete-files.d.ts +1 -1
  30. package/src/generators/{application → function}/lib/delete-files.js +1 -1
  31. package/src/generators/function/lib/delete-files.js.map +1 -0
  32. package/src/generators/function/lib/index.d.ts +3 -0
  33. package/src/generators/function/lib/index.js +7 -0
  34. package/src/generators/function/lib/index.js.map +1 -0
  35. package/src/generators/function/lib/update-project.d.ts +3 -0
  36. package/src/generators/function/lib/update-project.js +52 -0
  37. package/src/generators/function/lib/update-project.js.map +1 -0
  38. package/src/generators/function/schema.d.ts +51 -0
  39. package/src/generators/function/schema.json +57 -0
  40. package/src/generators/init/init.js +1 -5
  41. package/src/generators/init/init.js.map +1 -1
  42. package/src/generators/init/lib/add-dependencies.js +3 -4
  43. package/src/generators/init/lib/add-dependencies.js.map +1 -1
  44. package/src/generators/init/lib/add-git-ignore-entry.d.ts +1 -1
  45. package/src/generators/init/lib/add-git-ignore-entry.js +1 -0
  46. package/src/generators/init/lib/add-git-ignore-entry.js.map +1 -1
  47. package/src/generators/init/schema.d.ts +4 -4
  48. package/src/generators/init/schema.json +8 -7
  49. package/src/generators/sync/lib/firebase-changes.d.ts +3 -0
  50. package/src/generators/sync/lib/firebase-changes.js +102 -0
  51. package/src/generators/sync/lib/firebase-changes.js.map +1 -0
  52. package/src/generators/sync/lib/firebase-configs.d.ts +3 -0
  53. package/src/generators/sync/lib/firebase-configs.js +61 -0
  54. package/src/generators/sync/lib/firebase-configs.js.map +1 -0
  55. package/src/generators/sync/lib/firebase-projects.d.ts +20 -0
  56. package/src/generators/sync/lib/firebase-projects.js +75 -0
  57. package/src/generators/sync/lib/firebase-projects.js.map +1 -0
  58. package/src/generators/sync/lib/firebase-workspace.d.ts +3 -0
  59. package/src/generators/sync/lib/firebase-workspace.js +15 -0
  60. package/src/generators/sync/lib/firebase-workspace.js.map +1 -0
  61. package/src/generators/sync/lib/index.d.ts +7 -0
  62. package/src/generators/sync/lib/index.js +11 -0
  63. package/src/generators/sync/lib/index.js.map +1 -0
  64. package/src/generators/sync/lib/tags.d.ts +14 -0
  65. package/src/generators/sync/lib/tags.js +43 -0
  66. package/src/generators/sync/lib/tags.js.map +1 -0
  67. package/src/generators/sync/lib/types.d.ts +46 -0
  68. package/src/generators/sync/lib/types.js +5 -0
  69. package/src/generators/sync/lib/types.js.map +1 -0
  70. package/src/generators/sync/schema.d.ts +5 -0
  71. package/src/generators/sync/schema.json +19 -0
  72. package/src/generators/sync/sync.d.ts +8 -0
  73. package/src/generators/sync/sync.js +167 -0
  74. package/src/generators/sync/sync.js.map +1 -0
  75. package/src/utils/debug.d.ts +4 -0
  76. package/src/utils/debug.js +25 -0
  77. package/src/utils/debug.js.map +1 -0
  78. package/src/utils/firebase-config.d.ts +77 -0
  79. package/src/utils/firebase-config.js +52 -0
  80. package/src/utils/firebase-config.js.map +1 -0
  81. package/src/utils/index.d.ts +3 -0
  82. package/src/utils/index.js +3 -0
  83. package/src/utils/index.js.map +1 -1
  84. package/src/utils/project-name.d.ts +5 -0
  85. package/src/utils/project-name.js +38 -0
  86. package/src/utils/project-name.js.map +1 -0
  87. package/src/utils/update-tsconfig.d.ts +8 -0
  88. package/src/{generators/application/lib → utils}/update-tsconfig.js +5 -5
  89. package/src/utils/update-tsconfig.js.map +1 -0
  90. package/src/utils/versions.d.ts +1 -0
  91. package/src/utils/versions.js +5 -4
  92. package/src/utils/versions.js.map +1 -1
  93. package/src/executors/build/build.d.ts +0 -8
  94. package/src/executors/build/build.js +0 -82
  95. package/src/executors/build/build.js.map +0 -1
  96. package/src/executors/build/lib/copy-dependencies.d.ts +0 -3
  97. package/src/executors/build/lib/copy-dependencies.js +0 -53
  98. package/src/executors/build/lib/copy-dependencies.js.map +0 -1
  99. package/src/executors/build/lib/firebase-build.d.ts +0 -2
  100. package/src/executors/build/lib/firebase-build.js +0 -16
  101. package/src/executors/build/lib/firebase-build.js.map +0 -1
  102. package/src/executors/build/lib/get-dependencies.d.ts +0 -8
  103. package/src/executors/build/lib/get-dependencies.js +0 -87
  104. package/src/executors/build/lib/get-dependencies.js.map +0 -1
  105. package/src/executors/build/lib/index.d.ts +0 -1
  106. package/src/executors/build/lib/index.js +0 -5
  107. package/src/executors/build/lib/index.js.map +0 -1
  108. package/src/executors/build/lib/rewrite-package.d.ts +0 -8
  109. package/src/executors/build/lib/rewrite-package.js +0 -44
  110. package/src/executors/build/lib/rewrite-package.js.map +0 -1
  111. package/src/executors/build/schema.d.ts +0 -1
  112. package/src/executors/build/schema.json +0 -167
  113. package/src/generators/application/files/package.json__tmpl__ +0 -21
  114. package/src/generators/application/lib/add-project.d.ts +0 -39
  115. package/src/generators/application/lib/add-project.js +0 -115
  116. package/src/generators/application/lib/add-project.js.map +0 -1
  117. package/src/generators/application/lib/delete-files.js.map +0 -1
  118. package/src/generators/application/lib/normalize-options.d.ts +0 -5
  119. package/src/generators/application/lib/normalize-options.js +0 -44
  120. package/src/generators/application/lib/normalize-options.js.map +0 -1
  121. package/src/generators/application/lib/update-tsconfig.d.ts +0 -9
  122. package/src/generators/application/lib/update-tsconfig.js.map +0 -1
  123. package/src/utils/e2ePatch.d.ts +0 -2
  124. package/src/utils/e2ePatch.js +0 -135
  125. package/src/utils/e2ePatch.js.map +0 -1
  126. /package/src/generators/{application/files/src/index.ts__tmpl__ → function/files/src/main.ts__tmpl__} +0 -0
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # @simondotm/nx-firebase
2
2
 
3
- ![npm](https://img.shields.io/npm/dw/@simondotm/nx-firebase.svg)
4
-
5
- A plugin for [Nx](https://nx.dev) that provides support for Firebase projects in an Nx monorepo workspace.
3
+ A plugin for [Nx](https://nx.dev) v16.1.1+ that provides support for Firebase projects in an Nx monorepo workspace.
6
4
 
7
5
  See [CHANGELOG](https://github.com/simondotm/nx-firebase/blob/main/CHANGELOG.md) for release notes.
8
6
 
7
+ This plugin was completely rewritten since V2.x. For documentation of the legacy v1.x plugin version see [here](https://github.com/simondotm/nx-firebase/tree/release/v1.1.0).
8
+
9
9
  ## Overview
10
10
 
11
11
  Nx provides a great way to manage monorepo workflows and this plugin helps to integrate Firebase projects with Nx, by:
@@ -13,27 +13,27 @@ Nx provides a great way to manage monorepo workflows and this plugin helps to in
13
13
  1. Enabling & promoting use of shared Typescript code libraries within Firebase functions
14
14
  2. Retaining a familiar usage of all Firebase features in a way that feels integrated with Nx workflow
15
15
  3. Requiring minimal friction/setup for configuration of an Nx workspace in order to be productive with development, building & deployment of Firebase projects
16
- 4. Supporting multiple firebase projects within an Nx workspace
16
+ 4. Supporting multiple firebase projects & apps within an Nx workspace
17
17
 
18
18
  ## Nx-Firebase Features
19
19
 
20
20
  Supports:
21
21
 
22
- - Typescript Firebase functions as Nx applications
23
22
  - Single or multiple Firebase projects in one Nx workspace
24
- - Use of shared Nx buildable libraries in Firebase functions
23
+ - Firebase functions as Typescript Nx applications, now bundled using esbuild
24
+ - Use of shared Nx libraries in Firebase functions
25
25
  - Nx provides automatic dependency checking for builds
26
- - Building & serving functions with watch mode
27
- - Firebase Emulators
26
+ - Building & serving functions with watch mode & Firebase Emulators
28
27
  - Convenience Nx `getconfig` target to fetch remote firebase functions configuration variables to local `.runtimeconfig.json` file
29
- - Convenience Nx `deploy`, `emulate`, and `serve` targets for functions
28
+ - Convenience Nx `deploy` , and `serve` targets for functions
30
29
 
31
30
  Additionally:
32
31
 
33
- - Auto generates Firebase functions `package.json` ready for no fuss deployment using the Firebase CLI
32
+ - Auto bundles & generates Firebase functions `package.json` ready for no fuss deployment using the Firebase CLI
34
33
  - Auto generates default `firebase.json` configurations, rules and indexes for each Firebase app
35
34
  - Only very lightly opinionated about your Firebase configurations and workspace layouts; you can just use the Firebase CLI as usual
36
35
  - Keeps all of your firebase rules and indexes within your app folder, to keep your workspace root free of clutter
36
+ - Use the plugin `sync` generator to easily manage firebase workspaces & configurations
37
37
 
38
38
  ## Further Information
39
39
 
package/executors.json CHANGED
@@ -1,10 +1,2 @@
1
1
  {
2
- "$schema": "http://json-schema.org/schema",
3
- "executors": {
4
- "build": {
5
- "implementation": "./src/executors/build/build",
6
- "schema": "./src/executors/build/schema.json",
7
- "description": "build executor"
8
- }
9
- }
10
2
  }
package/generators.json CHANGED
@@ -14,6 +14,17 @@
14
14
  "schema": "./src/generators/application/schema.json",
15
15
  "description": "nx-firebase application generator",
16
16
  "aliases": ["app"]
17
+ },
18
+ "function": {
19
+ "factory": "./src/generators/function/function",
20
+ "schema": "./src/generators/function/schema.json",
21
+ "description": "nx-firebase function generator",
22
+ "aliases": ["func"]
23
+ },
24
+ "sync": {
25
+ "factory": "./src/generators/sync/sync",
26
+ "schema": "./src/generators/sync/schema.json",
27
+ "description": "nx-firebase project sync tool"
17
28
  }
18
29
  }
19
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simondotm/nx-firebase",
3
- "version": "1.1.0-beta.0",
3
+ "version": "2.0.0-beta.0",
4
4
  "description": "A Firebase plugin for Nx monorepo workspaces.",
5
5
  "author": "Simon Morris",
6
6
  "license": "MIT",
@@ -21,11 +21,14 @@
21
21
  "generators": "./generators.json",
22
22
  "executors": "./executors.json",
23
23
  "peerDependencies": {
24
- "@nx/workspace": ">= 13.10.6",
25
- "nx": ">= 13.10.6"
24
+ "@nx/workspace": ">= 16.1.1",
25
+ "nx": ">= 16.1.1"
26
26
  },
27
27
  "dependencies": {
28
- "fs-extra": "11.1.1"
28
+ "@nrwl/devkit": "16.1.1",
29
+ "@nrwl/node": "16.1.1",
30
+ "@nx/esbuild": "^16.1.1",
31
+ "@nx/node": "^16.1.1"
29
32
  },
30
33
  "types": "./src/index.d.ts"
31
34
  }
@@ -1,8 +1,8 @@
1
1
  import { GeneratorCallback, Tree } from '@nx/devkit';
2
- import type { ApplicationGeneratorOptions } from './schema';
2
+ import type { ApplicationGeneratorOptions, NormalizedOptions } from './schema';
3
+ export declare function normalizeOptions(tree: Tree, options: ApplicationGeneratorOptions): NormalizedOptions;
3
4
  /**
4
- * Firebase 'functions' application generator
5
- * Uses the `@nx/node` application generator as a base implementation
5
+ * Firebase application generator
6
6
  *
7
7
  * @param tree
8
8
  * @param rawOptions
@@ -1,15 +1,36 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.applicationSchematic = exports.applicationGenerator = void 0;
3
+ exports.applicationSchematic = exports.applicationGenerator = exports.normalizeOptions = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const devkit_1 = require("@nx/devkit");
6
- const node_1 = require("@nx/node");
7
- const init_1 = require("../init/init");
8
6
  const lib_1 = require("./lib");
9
- const delete_files_1 = require("./lib/delete-files");
7
+ const utils_1 = require("../../utils");
8
+ const init_1 = require("../init/init");
9
+ function normalizeOptions(tree, options) {
10
+ const { projectName, projectRoot } = (0, utils_1.getProjectName)(tree, options.name, options.directory);
11
+ /**
12
+ * Plugin filename naming convention for firebase.json config is:
13
+ * firebase config will be `firebase.json` for the first firebase app
14
+ * additional apps will use `firebase.<projectname>.json`
15
+ * this makes the config filename deterministic for the plugin
16
+ *
17
+ * - plugin can try `firebase.<projectname>.json` and use if exists
18
+ * - otherwise fallback is `firebase.json`
19
+ */
20
+ const firebaseConfigName = tree.exists('firebase.json')
21
+ ? `firebase.${projectName}.json`
22
+ : 'firebase.json';
23
+ // firebase config name has to be unique.
24
+ if (tree.exists(firebaseConfigName)) {
25
+ throw Error(`There is already a firebase configuration called '${firebaseConfigName}' in this workspace. Please use a different project name.`);
26
+ }
27
+ return Object.assign(Object.assign({}, options), { projectRoot,
28
+ projectName,
29
+ firebaseConfigName });
30
+ }
31
+ exports.normalizeOptions = normalizeOptions;
10
32
  /**
11
- * Firebase 'functions' application generator
12
- * Uses the `@nx/node` application generator as a base implementation
33
+ * Firebase application generator
13
34
  *
14
35
  * @param tree
15
36
  * @param rawOptions
@@ -17,21 +38,100 @@ const delete_files_1 = require("./lib/delete-files");
17
38
  */
18
39
  function applicationGenerator(tree, rawOptions) {
19
40
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
20
- const options = (0, lib_1.normalizeOptions)(tree, rawOptions);
21
- const initTask = yield (0, init_1.initGenerator)(tree, {
22
- unitTestRunner: options.unitTestRunner,
23
- skipFormat: true,
41
+ const options = normalizeOptions(tree, rawOptions);
42
+ const initTask = yield (0, init_1.default)(tree, {});
43
+ const firebaseCliProject = options.project
44
+ ? ` --project=${options.project}`
45
+ : '';
46
+ const tags = [`firebase:app`, `firebase:name:${options.projectName}`];
47
+ if (options.tags) {
48
+ options.tags.split(',').map((s) => {
49
+ s.trim();
50
+ tags.push(s);
51
+ });
52
+ }
53
+ (0, devkit_1.addProjectConfiguration)(tree, options.projectName, {
54
+ root: options.projectRoot,
55
+ projectType: 'application',
56
+ targets: {
57
+ build: {
58
+ executor: 'nx:run-commands',
59
+ options: {
60
+ command: `echo Build succeeded.`,
61
+ },
62
+ },
63
+ watch: {
64
+ executor: 'nx:run-commands',
65
+ options: {
66
+ command: `nx run-many --targets=build --projects=tag:firebase:dep:${options.projectName} --parallel=100 --watch`,
67
+ },
68
+ },
69
+ lint: {
70
+ executor: 'nx:run-commands',
71
+ options: {
72
+ command: `nx run-many --targets=lint --projects=tag:firebase:dep:${options.projectName} --parallel=100`,
73
+ },
74
+ },
75
+ test: {
76
+ executor: 'nx:run-commands',
77
+ options: {
78
+ command: `nx run-many --targets=test --projects=tag:firebase:dep:${options.projectName} --parallel=100`,
79
+ },
80
+ },
81
+ firebase: {
82
+ executor: 'nx:run-commands',
83
+ options: {
84
+ command: `firebase --config=${options.firebaseConfigName}${firebaseCliProject}`,
85
+ },
86
+ configurations: {
87
+ production: {
88
+ command: `firebase --config=${options.firebaseConfigName}${firebaseCliProject}`,
89
+ },
90
+ },
91
+ },
92
+ killports: {
93
+ executor: 'nx:run-commands',
94
+ options: {
95
+ command: `kill-port --port 9099,5001,8080,9000,5000,8085,9199,9299,4000,4400,4500`,
96
+ },
97
+ },
98
+ getconfig: {
99
+ executor: 'nx:run-commands',
100
+ options: {
101
+ command: `nx run ${options.projectName}:firebase functions:config:get > ${options.projectRoot}/.runtimeconfig.json`,
102
+ },
103
+ },
104
+ emulate: {
105
+ executor: 'nx:run-commands',
106
+ options: {
107
+ commands: [
108
+ `nx run ${options.projectName}:killports`,
109
+ `nx run ${options.projectName}:firebase emulators:start --import=${options.projectRoot}/.emulators --export-on-exit`,
110
+ ],
111
+ parallel: false,
112
+ },
113
+ },
114
+ serve: {
115
+ executor: 'nx:run-commands',
116
+ options: {
117
+ commands: [
118
+ `nx run ${options.projectName}:watch`,
119
+ `nx run ${options.projectName}:emulate`,
120
+ ],
121
+ },
122
+ },
123
+ deploy: {
124
+ executor: 'nx:run-commands',
125
+ dependsOn: ['build'],
126
+ options: {
127
+ command: `nx run ${options.projectName}:firebase deploy`,
128
+ },
129
+ },
130
+ },
131
+ tags,
24
132
  });
25
- const nodeApplicationTask = yield (0, node_1.applicationGenerator)(tree, (0, lib_1.toNodeApplicationGeneratorOptions)(options));
26
- (0, delete_files_1.deleteFiles)(tree, options);
27
133
  (0, lib_1.createFiles)(tree, options);
28
- (0, lib_1.updateTsConfig)(tree, options);
29
- (0, lib_1.addProject)(tree, options);
30
- // ensures newly added files are formatted to match workspace style
31
- if (!options.skipFormat) {
32
- yield (0, devkit_1.formatFiles)(tree);
33
- }
34
- return (0, devkit_1.runTasksInSerial)(initTask, nodeApplicationTask);
134
+ return (0, devkit_1.runTasksInSerial)(initTask);
35
135
  });
36
136
  }
37
137
  exports.applicationGenerator = applicationGenerator;
@@ -1 +1 @@
1
- {"version":3,"file":"application.js","sourceRoot":"","sources":["../../../../../../packages/nx-firebase/src/generators/application/application.ts"],"names":[],"mappings":";;;;AAEA,uCAA8E;AAC9E,mCAA2E;AAC3E,uCAA4C;AAC5C,+BAMc;AACd,qDAAgD;AAGhD;;;;;;;GAOG;AACH,SAAsB,oBAAoB,CACxC,IAAU,EACV,UAAuC;;QAEvC,MAAM,OAAO,GAAG,IAAA,sBAAgB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAA;QAClD,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAa,EAAC,IAAI,EAAE;YACzC,cAAc,EAAE,OAAO,CAAC,cAAc;YACtC,UAAU,EAAE,IAAI;SACjB,CAAC,CAAA;QACF,MAAM,mBAAmB,GAAG,MAAM,IAAA,2BAAwB,EACxD,IAAI,EACJ,IAAA,uCAAiC,EAAC,OAAO,CAAC,CAE3C,CAAA;QACD,IAAA,0BAAW,EAAC,IAAI,EAAE,OAAO,CAAC,CAAA;QAC1B,IAAA,iBAAW,EAAC,IAAI,EAAE,OAAO,CAAC,CAAA;QAC1B,IAAA,oBAAc,EAAC,IAAI,EAAE,OAAO,CAAC,CAAA;QAC7B,IAAA,gBAAU,EAAC,IAAI,EAAE,OAAO,CAAC,CAAA;QAEzB,mEAAmE;QACnE,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YACvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAA;SACxB;QAED,OAAO,IAAA,yBAAgB,EAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAA;IACxD,CAAC;CAAA;AAzBD,oDAyBC;AAED,kBAAe,oBAAoB,CAAA;AAEtB,QAAA,oBAAoB,GAAG,IAAA,2BAAkB,EAAC,oBAAoB,CAAC,CAAA"}
1
+ {"version":3,"file":"application.js","sourceRoot":"","sources":["../../../../../../packages/nx-firebase/src/generators/application/application.ts"],"names":[],"mappings":"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"}
@@ -1,4 +1,4 @@
1
- # <%= name %>
1
+ # <%= projectName %>
2
2
 
3
3
  This Nx Firebase application was generated by [@simondotm/nx-firebase](https://github.com/simondotm/nx-firebase).
4
4
 
@@ -6,31 +6,34 @@ This Nx Firebase application was generated by [@simondotm/nx-firebase](https://g
6
6
 
7
7
  * `database.rules.json` - Default Firebase Realtime Database Rules
8
8
  * `firestore.indexes.json` - Default Firebase Firestore Database Rules
9
- * `package.json` - Default Firebase Functions package
10
9
  * `storage.rules` - Default Firebase Storage Rules
11
- * `src/index.ts` - Default Firebase Functions entry point
12
10
  * `public/index.ts` - Default Firebase hosting site
13
11
 
14
12
  ## Generated Workspace Root Files
15
13
 
16
14
  * `<%= firebaseAppConfig %>` - Firebase CLI Configuration for this project
17
15
  * `.firebaserc` - Default Firebase CLI Deployment Targets Configuration
18
- * `firebase.json` - Intentionally Empty Firebase CLI Configuration (only needed to allow Firebase CLI to run in your workspace)
19
16
 
20
- ## Generated modules
17
+ ## Generated dependencies
21
18
 
22
- Nx-Firebase will add `firebase-admin` and `firebase-functions` to your workspace `package.json` at the `'latest'` version. You may wish to set these to a specific version.
19
+ Nx-Firebase will add `firebase-tools`, `firebase-admin` and `firebase-functions` to your workspace if they do not already exist.
23
20
 
24
21
  ## Next Steps
25
22
 
26
- * `npm install -g firebase-tools` - Install the [Firebase CLI](https://firebase.google.com/docs/cli)
23
+ * Read about the [Firebase CLI here](https://firebase.google.com/docs/cli)
27
24
  * `firebase login` - Authenticate the Firebase CLI
28
25
  * `firebase use --add` - Add your Firebase Project as a target to `.firebaserc`
29
- * You do not need to `npm install` in the app project directory, but can still add and run custom npm scripts to the app `package.json` if you wish
26
+ * `nx g @simondotm/nx-firebase:function my-function --firebaseApp <%= projectName %>` - Add a firebase function to this project
30
27
 
28
+ See the plugin [README](https://github.com/simondotm/nx-firebase/blob/main/README.md) for more information.
31
29
 
30
+ ## Commands
32
31
 
33
- See the plugin [README](https://github.com/simondotm/nx-firebase/blob/main/README.md) for more information.
32
+ * `nx run <%= projectName %>:deploy` - Deploy this app to firebase
33
+ * `nx run <%= projectName %>:serve` - Serve this app using the firebase emulator
34
+ * `nx run <%= projectName %>:build` - Build all functions associated with this app
35
+ * `nx run <%= projectName %>:test` - Test all functions associated with this app
36
+ * `nx run <%= projectName %>:lint` - Lint all functions associated with this app
34
37
 
35
38
 
36
39
 
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "database": {
3
- "rules": "<%= root %>/database.rules.json"
3
+ "rules": "<%= projectRoot %>/database.rules.json"
4
4
  },
5
5
  "firestore": {
6
- "rules": "<%= root %>/firestore.rules",
7
- "indexes": "<%= root %>/firestore.indexes.json"
6
+ "rules": "<%= projectRoot %>/firestore.rules",
7
+ "indexes": "<%= projectRoot %>/firestore.indexes.json"
8
8
  },
9
9
  "hosting": {
10
- "public": "<%= root %>/public",
10
+ "public": "<%= projectRoot %>/public",
11
11
  "ignore": [
12
12
  "firebase.json",
13
13
  "**/.*",
@@ -21,16 +21,9 @@
21
21
  ]
22
22
  },
23
23
  "storage": {
24
- "rules": "<%= root %>/storage.rules"
25
- },
26
- "functions": {
27
- "codebase": "<%= name %>",
28
- "predeploy": [
29
- "npx nx build <%= name %>"
30
- ],
31
- "runtime": "<%= firebaseNodeRuntime %>",
32
- "source": "dist/<%= root %>"
24
+ "rules": "<%= projectRoot %>/storage.rules"
33
25
  },
26
+ "functions": [],
34
27
  "emulators": {
35
28
  "auth": {
36
29
  "port": 9099
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "database": {
3
- "rules": "<%= root %>/database.rules.json"
3
+ "rules": "<%= projectRoot %>/database.rules.json"
4
4
  },
5
5
  "firestore": {
6
- "rules": "<%= root %>/firestore.rules",
7
- "indexes": "<%= root %>/firestore.indexes.json"
6
+ "rules": "<%= projectRoot %>/firestore.rules",
7
+ "indexes": "<%= projectRoot %>/firestore.indexes.json"
8
8
  },
9
9
  "hosting": {
10
- "public": "<%= root %>/public",
10
+ "public": "<%= projectRoot %>/public",
11
11
  "ignore": [
12
12
  "firebase.json",
13
13
  "**/.*",
@@ -21,16 +21,9 @@
21
21
  ]
22
22
  },
23
23
  "storage": {
24
- "rules": "<%= root %>/storage.rules"
25
- },
26
- "functions": {
27
- "codebase": "<%= name %>",
28
- "predeploy": [
29
- "npx nx build <%= name %>"
30
- ],
31
- "runtime": "<%= firebaseNodeRuntime %>",
32
- "source": "dist/<%= root %>"
24
+ "rules": "<%= projectRoot %>/storage.rules"
33
25
  },
26
+ "functions": [],
34
27
  "emulators": {
35
28
  "auth": {
36
29
  "port": 9099
@@ -2,8 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createFiles = void 0;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const devkit_2 = require("@nx/devkit");
6
- const utils_1 = require("../../../utils");
7
5
  /**
8
6
  * Generate the firebase app specific files
9
7
  *
@@ -12,16 +10,11 @@ const utils_1 = require("../../../utils");
12
10
  */
13
11
  function createFiles(tree, options) {
14
12
  const firebaseAppConfig = options.firebaseConfigName;
15
- const firebaseAppConfigPath = (0, devkit_2.joinPathFragments)((0, devkit_1.offsetFromRoot)(options.projectRoot), firebaseAppConfig);
16
13
  const substitutions = {
17
14
  tmpl: '',
18
- name: options.projectName,
19
- root: options.projectRoot,
20
- firebaseAppName: options.name,
15
+ projectName: options.projectName,
16
+ projectRoot: options.projectRoot,
21
17
  firebaseAppConfig,
22
- firebaseAppConfigPath,
23
- firebaseNodeRuntime: utils_1.firebaseNodeRuntime,
24
- firebaseNodeEngine: utils_1.firebaseNodeEngine,
25
18
  };
26
19
  // The default functions package.json & templated typescript source files are added here
27
20
  // to match the `firebase init` cli setup
@@ -30,29 +23,21 @@ function createFiles(tree, options) {
30
23
  // Rules and index files also get generated in the application folder;
31
24
  // 1. so that they dont clutter up the root workspace
32
25
  // 2. so that they are located within the nx firebase application project they relate to
33
- (0, devkit_2.generateFiles)(tree, (0, devkit_2.joinPathFragments)(__dirname, '..', 'files'), options.projectRoot, substitutions);
34
- // app project, so that it can be easily located with the cli command, and also enables nx workspaces
35
- // to contain multiple firebase projects
36
- // firebase.*.json files have to go in the root of the workspace, because firebase function deployment only allows
37
- // the deployed package for functions to exist in a sub directory from where the firebase.json config is located
38
- // In principle for users that are not using the firebase functions feature, they could put this firebase.json config
39
- // inside their app folder, but it's better to have consistent behaviour for every workspace
40
- // generate these firebase files in the root workspace only if they dont already exist
41
- // ( since we dont want to overwrite any existing configs)
42
- // create firebase config file in the root of the workspace.
43
- // use `firebase.json` as the first firebase project config
44
- // use `firebase.<project-name>.json` for subsequent project configs
45
- if (!tree.exists('firebase.json')) {
46
- (0, devkit_2.generateFiles)(tree, (0, devkit_2.joinPathFragments)(__dirname, '..', 'files_firebase'), '', substitutions);
26
+ (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '..', 'files'), options.projectRoot, substitutions);
27
+ // The first firebase app project in a workspace will always use `firebase.json` as its config file
28
+ // Subsequent firebase app projects will be assigned a config file based on the project name, so `firebase.<project-name>.json`
29
+ if (firebaseAppConfig === 'firebase.json') {
30
+ // if (!tree.exists('firebase.json')) {
31
+ (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '..', 'files_firebase'), '', substitutions);
47
32
  }
48
33
  else {
49
- (0, devkit_2.generateFiles)(tree, (0, devkit_2.joinPathFragments)(__dirname, '..', 'files_workspace'), '', // SM: this is a tree path, not a file system path
34
+ (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '..', 'files_workspace'), '', // SM: this is a tree path, not a file system path
50
35
  substitutions);
51
36
  }
52
37
  // For a fresh workspace, the firebase CLI needs at least a firebase.json and an empty .firebaserc
53
38
  // in order to use commands like 'firebase use --add'
54
39
  if (!tree.exists('.firebaserc')) {
55
- (0, devkit_2.generateFiles)(tree, (0, devkit_2.joinPathFragments)(__dirname, '..', 'files_firebaserc'), '', substitutions);
40
+ (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '..', 'files_firebaserc'), '', substitutions);
56
41
  }
57
42
  // else {
58
43
  // logger.log('✓ .firebaserc already exists in this workspace')
@@ -1 +1 @@
1
- {"version":3,"file":"create-files.js","sourceRoot":"","sources":["../../../../../../../packages/nx-firebase/src/generators/application/lib/create-files.ts"],"names":[],"mappings":";;;AAAA,uCAAiD;AACjD,uCAA6D;AAC7D,0CAAwE;AAGxE;;;;;GAKG;AACH,SAAgB,WAAW,CAAC,IAAU,EAAE,OAA0B;IAChE,MAAM,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAA;IACpD,MAAM,qBAAqB,GAAG,IAAA,0BAAiB,EAC7C,IAAA,uBAAc,EAAC,OAAO,CAAC,WAAW,CAAC,EACnC,iBAAiB,CAClB,CAAA;IAED,MAAM,aAAa,GAAG;QACpB,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,OAAO,CAAC,WAAW;QACzB,IAAI,EAAE,OAAO,CAAC,WAAW;QAEzB,eAAe,EAAE,OAAO,CAAC,IAAI;QAC7B,iBAAiB;QACjB,qBAAqB;QAErB,mBAAmB,EAAnB,2BAAmB;QACnB,kBAAkB,EAAlB,0BAAkB;KACnB,CAAA;IAED,wFAAwF;IACxF,yCAAyC;IACzC,uGAAuG;IACvG,EAAE;IACF,sEAAsE;IACtE,qDAAqD;IACrD,wFAAwF;IACxF,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,0BAAiB,EAAC,SAAS,EAAE,IAAI,EAAE,OAAO,CAAC,EAC3C,OAAO,CAAC,WAAW,EACnB,aAAa,CACd,CAAA;IAED,qGAAqG;IACrG,wCAAwC;IACxC,kHAAkH;IAClH,iHAAiH;IACjH,qHAAqH;IACrH,6FAA6F;IAE7F,sFAAsF;IACtF,0DAA0D;IAE1D,4DAA4D;IAC5D,2DAA2D;IAC3D,oEAAoE;IACpE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE;QACjC,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,0BAAiB,EAAC,SAAS,EAAE,IAAI,EAAE,gBAAgB,CAAC,EACpD,EAAE,EACF,aAAa,CACd,CAAA;KACF;SAAM;QACL,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,0BAAiB,EAAC,SAAS,EAAE,IAAI,EAAE,iBAAiB,CAAC,EACrD,EAAE,EAAE,kDAAkD;QACtD,aAAa,CACd,CAAA;KACF;IAED,kGAAkG;IAClG,sDAAsD;IACtD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE;QAC/B,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,0BAAiB,EAAC,SAAS,EAAE,IAAI,EAAE,kBAAkB,CAAC,EACtD,EAAE,EACF,aAAa,CACd,CAAA;KACF;IACD,SAAS;IACT,iEAAiE;IACjE,IAAI;AACN,CAAC;AA5ED,kCA4EC"}
1
+ {"version":3,"file":"create-files.js","sourceRoot":"","sources":["../../../../../../../packages/nx-firebase/src/generators/application/lib/create-files.ts"],"names":[],"mappings":";;;AAAA,uCAAmE;AAInE;;;;;GAKG;AACH,SAAgB,WAAW,CAAC,IAAU,EAAE,OAA0B;IAChE,MAAM,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAA;IAEpD,MAAM,aAAa,GAAG;QACpB,IAAI,EAAE,EAAE;QACR,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,iBAAiB;KAClB,CAAA;IAED,wFAAwF;IACxF,yCAAyC;IACzC,uGAAuG;IACvG,EAAE;IACF,sEAAsE;IACtE,qDAAqD;IACrD,wFAAwF;IACxF,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,0BAAiB,EAAC,SAAS,EAAE,IAAI,EAAE,OAAO,CAAC,EAC3C,OAAO,CAAC,WAAW,EACnB,aAAa,CACd,CAAA;IAED,mGAAmG;IACnG,+HAA+H;IAC/H,IAAI,iBAAiB,KAAK,eAAe,EAAE;QACzC,wCAAwC;QACxC,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,0BAAiB,EAAC,SAAS,EAAE,IAAI,EAAE,gBAAgB,CAAC,EACpD,EAAE,EACF,aAAa,CACd,CAAA;KACF;SAAM;QACL,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,0BAAiB,EAAC,SAAS,EAAE,IAAI,EAAE,iBAAiB,CAAC,EACrD,EAAE,EAAE,kDAAkD;QACtD,aAAa,CACd,CAAA;KACF;IAED,kGAAkG;IAClG,sDAAsD;IACtD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE;QAC/B,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,0BAAiB,EAAC,SAAS,EAAE,IAAI,EAAE,kBAAkB,CAAC,EACtD,EAAE,EACF,aAAa,CACd,CAAA;KACF;IACD,SAAS;IACT,iEAAiE;IACjE,IAAI;AACN,CAAC;AAxDD,kCAwDC"}
@@ -1,4 +1 @@
1
1
  export * from './create-files';
2
- export * from './normalize-options';
3
- export * from './update-tsconfig';
4
- export * from './add-project';
@@ -2,7 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./create-files"), exports);
5
- tslib_1.__exportStar(require("./normalize-options"), exports);
6
- tslib_1.__exportStar(require("./update-tsconfig"), exports);
7
- tslib_1.__exportStar(require("./add-project"), exports);
8
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/nx-firebase/src/generators/application/lib/index.ts"],"names":[],"mappings":";;;AAAA,yDAA8B;AAC9B,8DAAmC;AACnC,4DAAiC;AACjC,wDAA6B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/nx-firebase/src/generators/application/lib/index.ts"],"names":[],"mappings":";;;AAAA,yDAA8B"}
@@ -1,23 +1,15 @@
1
- import { Linter } from '@nx/linter'
2
- import { UnitTestRunner } from '../../utils/test-runners'
3
-
4
1
  export interface ApplicationGeneratorOptions {
5
2
  // standard @nx/node:app options
6
3
  name: string
7
4
  directory?: string
8
- frontendProject?: string
9
- linter?: Linter
10
- skipFormat?: boolean
11
- skipPackageJson?: boolean
12
- standaloneConfig?: boolean
13
5
  tags?: string
14
- unitTestRunner?: UnitTestRunner
15
- setParserOptionsProject?: boolean
16
6
  // extra options for @simondotm/nx-firebase:app generator
17
7
  project?: string
8
+ // firebaseProject?: string
9
+ // firebaseConfig?: string
18
10
  }
19
11
 
20
- interface NormalizedOptions extends ApplicationGeneratorOptions {
12
+ export interface NormalizedOptions extends ApplicationGeneratorOptions {
21
13
  projectRoot: Path
22
14
  projectName: string
23
15
  firebaseConfigName: string
@@ -18,51 +18,10 @@
18
18
  "description": "The directory of the new application.",
19
19
  "type": "string"
20
20
  },
21
- "skipFormat": {
22
- "description": "Skip formatting files.",
23
- "type": "boolean",
24
- "default": false
25
- },
26
- "skipPackageJson": {
27
- "description": "Do not add dependencies to `package.json`.",
28
- "type": "boolean",
29
- "default": false
30
- },
31
- "linter": {
32
- "description": "The tool to use for running lint checks.",
33
- "type": "string",
34
- "enum": [
35
- "eslint",
36
- "none"
37
- ],
38
- "default": "eslint"
39
- },
40
- "unitTestRunner": {
41
- "description": "Test runner to use for unit tests.",
42
- "type": "string",
43
- "enum": [
44
- "jest",
45
- "none"
46
- ],
47
- "default": "jest"
48
- },
49
21
  "tags": {
50
22
  "description": "Add tags to the application (used for linting).",
51
23
  "type": "string"
52
24
  },
53
- "frontendProject": {
54
- "description": "Frontend project that needs to access this application. This sets up proxy configuration.",
55
- "type": "string"
56
- },
57
- "standaloneConfig": {
58
- "description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
59
- "type": "boolean"
60
- },
61
- "setParserOptionsProject": {
62
- "type": "boolean",
63
- "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
64
- "default": false
65
- },
66
25
  "project": {
67
26
  "type": "string",
68
27
  "description": "The firebase project that should be associated with this application",
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "<%= projectName %>",
3
+ "description": "Firebase Function, auto generated by @simondotm/nx-firebase",
4
+ "scripts": {
5
+ "test": "nx test <%= projectName %>",
6
+ "lint": "nx lint <%= projectName %>",
7
+ "build": "nx build <%= projectName %>",
8
+ "deploy": "nx deploy <%= projectName %>",
9
+ },
10
+ "type": "<%= moduleType %>",
11
+ "engines": {
12
+ "node": "<%= firebaseNodeEngine %>"
13
+ },
14
+ "dependencies": {
15
+ },
16
+ "devDependencies": {
17
+ },
18
+ "private": true
19
+ }
@@ -0,0 +1,31 @@
1
+ # <%= projectName %>
2
+
3
+ This Nx Firebase function was generated by [@simondotm/nx-firebase](https://github.com/simondotm/nx-firebase).
4
+
5
+ ## Generated Application Files
6
+
7
+ * `src/main.ts` - Default Firebase Functions entry point
8
+
9
+ ## Generated Workspace Root Files
10
+
11
+ * `<%= firebaseAppConfig %>` - Firebase CLI Configuration for this project
12
+ * `.firebaserc` - Default Firebase CLI Deployment Targets Configuration
13
+ * `firebase.json` - Intentionally Empty Firebase CLI Configuration (only needed to allow Firebase CLI to run in your workspace)
14
+
15
+ ## Generated modules
16
+
17
+ Nx-Firebase will add `firebase-admin` and `firebase-functions` to your workspace `package.json` at the `'latest'` version. You may wish to set these to a specific version.
18
+
19
+ ## Next Steps
20
+
21
+ * `npm install -g firebase-tools` - Install the [Firebase CLI](https://firebase.google.com/docs/cli)
22
+ * `firebase login` - Authenticate the Firebase CLI
23
+ * `firebase use --add` - Add your Firebase Project as a target to `.firebaserc`
24
+ * You do not need to `npm install` in the app project directory, but can still add and run custom npm scripts to the app `package.json` if you wish
25
+
26
+
27
+
28
+ See the plugin [README](https://github.com/simondotm/nx-firebase/blob/main/README.md) for more information.
29
+
30
+
31
+