@simondotm/nx-firebase 2.1.2 → 2.3.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 (65) hide show
  1. package/README.md +106 -21
  2. package/executors.json +2 -2
  3. package/generators.json +1 -1
  4. package/package.json +8 -10
  5. package/src/__generated__/nx-firebase-versions.d.ts +11 -0
  6. package/src/__generated__/nx-firebase-versions.js +19 -0
  7. package/src/__generated__/nx-firebase-versions.js.map +1 -0
  8. package/src/executors/serve/schema.json +3 -3
  9. package/src/generators/application/application.d.ts +6 -6
  10. package/src/generators/application/application.js +65 -36
  11. package/src/generators/application/application.js.map +1 -1
  12. package/src/generators/application/files/firestore.indexes.json +25 -2
  13. package/src/generators/application/files/firestore.rules +10 -6
  14. package/src/generators/application/files/public/404.html +33 -0
  15. package/src/generators/application/files/public/index.html +11 -11
  16. package/src/generators/application/files/storage.rules +6 -3
  17. package/src/generators/application/lib/create-files.d.ts +2 -2
  18. package/src/generators/application/lib/create-files.js +11 -0
  19. package/src/generators/application/lib/create-files.js.map +1 -1
  20. package/src/generators/application/schema.d.ts +9 -4
  21. package/src/generators/application/schema.json +14 -9
  22. package/src/generators/function/files/package.json__tmpl__ +1 -1
  23. package/src/generators/function/files/src/main.ts__tmpl__ +4 -7
  24. package/src/generators/function/function.d.ts +6 -6
  25. package/src/generators/function/function.js +63 -26
  26. package/src/generators/function/function.js.map +1 -1
  27. package/src/generators/function/lib/add-function-config.d.ts +2 -2
  28. package/src/generators/function/lib/add-function-config.js +2 -2
  29. package/src/generators/function/lib/add-function-config.js.map +1 -1
  30. package/src/generators/function/lib/create-files.d.ts +3 -3
  31. package/src/generators/function/lib/create-files.js +16 -5
  32. package/src/generators/function/lib/create-files.js.map +1 -1
  33. package/src/generators/function/lib/delete-files.d.ts +3 -3
  34. package/src/generators/function/lib/delete-files.js +3 -3
  35. package/src/generators/function/lib/delete-files.js.map +1 -1
  36. package/src/generators/function/lib/update-project.d.ts +2 -2
  37. package/src/generators/function/lib/update-project.js +4 -4
  38. package/src/generators/function/lib/update-project.js.map +1 -1
  39. package/src/generators/function/schema.d.ts +15 -11
  40. package/src/generators/function/schema.json +12 -6
  41. package/src/generators/init/init.d.ts +4 -8
  42. package/src/generators/init/init.js +12 -15
  43. package/src/generators/init/init.js.map +1 -1
  44. package/src/generators/init/lib/add-dependencies.js +27 -27
  45. package/src/generators/init/lib/add-dependencies.js.map +1 -1
  46. package/src/generators/init/lib/index.d.ts +0 -1
  47. package/src/generators/init/lib/index.js +0 -1
  48. package/src/generators/init/lib/index.js.map +1 -1
  49. package/src/generators/init/schema.d.ts +1 -4
  50. package/src/generators/init/schema.json +0 -11
  51. package/src/generators/migrate/schema.json +1 -2
  52. package/src/utils/index.d.ts +0 -1
  53. package/src/utils/index.js +0 -1
  54. package/src/utils/index.js.map +1 -1
  55. package/src/utils/update-tsconfig.d.ts +1 -0
  56. package/src/utils/update-tsconfig.js +13 -3
  57. package/src/utils/update-tsconfig.js.map +1 -1
  58. package/src/utils/workspace.js +5 -3
  59. package/src/utils/workspace.js.map +1 -1
  60. package/src/generators/init/lib/normalize-options.d.ts +0 -2
  61. package/src/generators/init/lib/normalize-options.js +0 -9
  62. package/src/generators/init/lib/normalize-options.js.map +0 -1
  63. package/src/utils/versions.d.ts +0 -13
  64. package/src/utils/versions.js +0 -33
  65. package/src/utils/versions.js.map +0 -1
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addDependencies = void 0;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const utils_1 = require("../../../utils");
6
- const versions_1 = require("../../../utils/versions");
6
+ const nx_firebase_versions_1 = require("../../../__generated__/nx-firebase-versions");
7
7
  function addDependencies(tree) {
8
8
  const dependencies = {};
9
9
  const devDependencies = {};
@@ -11,44 +11,44 @@ function addDependencies(tree) {
11
11
  // This is atypical for Nx plugins that usually migrate versions automatically
12
12
  // however the nx-firebase plugin is not (currently) opinionated about which version is needed,
13
13
  // so this ensures workspaces retain control over their firebase versions.
14
- const packageJson = (0, devkit_1.readJson)(tree, 'package.json'); //readRootPackageJson()
14
+ const packageJson = (0, devkit_1.readJson)(tree, 'package.json');
15
15
  function addDependencyIfNotPresent(packageName, packageVersion) {
16
- if (!packageJson.dependencies[packageName]) {
16
+ if (!packageJson.dependencies || !packageJson.dependencies[packageName]) {
17
17
  dependencies[packageName] = packageVersion;
18
+ return true;
18
19
  }
20
+ return false;
19
21
  }
20
22
  function addDevDependencyIfNotPresent(packageName, packageVersion) {
21
- if (!packageJson.devDependencies[packageName]) {
23
+ if (!packageJson.devDependencies ||
24
+ !packageJson.devDependencies[packageName]) {
22
25
  devDependencies[packageName] = packageVersion;
26
+ return true;
27
+ }
28
+ return false;
29
+ }
30
+ // Firebase packages are not managed by the plugin
31
+ // but they are added if they do not exist already in the workspace
32
+ addDependencyIfNotPresent('firebase', `^${nx_firebase_versions_1.packageVersions.firebase}`);
33
+ addDependencyIfNotPresent('firebase-admin', `^${nx_firebase_versions_1.packageVersions.firebaseAdmin}`);
34
+ addDependencyIfNotPresent('firebase-functions', `^${nx_firebase_versions_1.packageVersions.firebaseFunctions}`);
35
+ // if the workspace uses pnpm, we need to add the @google-cloud/functions-framework package
36
+ if ((0, devkit_1.detectPackageManager)() === 'pnpm') {
37
+ if (addDependencyIfNotPresent('@google-cloud/functions-framework', `^${nx_firebase_versions_1.packageVersions.googleCloudFunctionsFramework}`)) {
38
+ devkit_1.logger.info(`This workspace is using pnpm, adding '@google-cloud/functions-framework' dependency for firebase functions compatibility\nSee https://github.com/firebase/firebase-tools/issues/5911#issuecomment-1730263400\n\n`);
23
39
  }
24
40
  }
25
- // firebase dependencies
26
- addDependencyIfNotPresent('firebase', versions_1.firebaseVersion);
27
- addDependencyIfNotPresent('firebase-admin', versions_1.firebaseAdminVersion);
28
- addDependencyIfNotPresent('firebase-functions', versions_1.firebaseFunctionsVersion);
29
- //SM: not convinced we should be adding tslib in this plugin
30
- //addDependencyIfNotPresent('tslib', tsLibVersion)
31
41
  // firebase dev dependencies
32
- addDevDependencyIfNotPresent('firebase-tools', versions_1.firebaseToolsVersion);
33
- addDevDependencyIfNotPresent('firebase-functions-test', versions_1.firebaseFunctionsTestVersion);
42
+ addDevDependencyIfNotPresent('firebase-tools', `^${nx_firebase_versions_1.packageVersions.firebaseTools}`);
43
+ addDevDependencyIfNotPresent('firebase-functions-test', `^${nx_firebase_versions_1.packageVersions.firebaseFunctionsTest}`);
34
44
  // kill-port is used by the emulate target to ensure clean emulator startup
35
45
  // since Nx doesn't kill processes cleanly atm
36
- addDevDependencyIfNotPresent('kill-port', versions_1.killportVersion);
37
- // TODO: find out if Nx devkit adds these versions even if they already exist
38
- // for now, only add them if they aren't in the workspace already at the same version as the host workspace
39
- // from:
40
- // https://github.com/nrwl/nx/blob/5b7dba1cb78cabcf631129b4ce8163406b9c1328/packages/devkit/src/utils/package-json.ts#L84
41
- //
42
- // These dependencies are required by the plugin internals, most likely already in the host workspace
43
- // but add them if not. They are added with the same version that the host workspace is using.
44
- // This is cleaner than using peerDeps.
45
- addDevDependencyIfNotPresent('@nx/devkit', utils_1.workspaceNxVersion.version);
46
- // used by the plugin function generator as a proxy for creating a typescript app
46
+ addDevDependencyIfNotPresent('kill-port', `^${nx_firebase_versions_1.packageVersions.killPort}`);
47
+ // @nx/node is used by the plugin function generator as a proxy for creating a typescript app
48
+ // since users have to create a firebase app before they generate a function, we can be sure
49
+ // this plugin init will have been run before the function generator that requires @nx/node is used
50
+ // we defer to @nx/node to install its own plugins such as @nx/eslint, @nx/jest, @nx/js, @nx/esbuild, @nx/webpack etc.
47
51
  addDevDependencyIfNotPresent('@nx/node', utils_1.workspaceNxVersion.version);
48
- addDevDependencyIfNotPresent('@nx/linter', utils_1.workspaceNxVersion.version);
49
- addDevDependencyIfNotPresent('@nx/jest', utils_1.workspaceNxVersion.version);
50
- addDevDependencyIfNotPresent('@nx/esbuild', utils_1.workspaceNxVersion.version);
51
- addDevDependencyIfNotPresent('@nx/js', utils_1.workspaceNxVersion.version);
52
52
  return (0, devkit_1.addDependenciesToPackageJson)(tree, dependencies, devDependencies);
53
53
  }
54
54
  exports.addDependencies = addDependencies;
@@ -1 +1 @@
1
- {"version":3,"file":"add-dependencies.js","sourceRoot":"","sources":["../../../../../../../packages/nx-firebase/src/generators/init/lib/add-dependencies.ts"],"names":[],"mappings":";;;AAAA,uCAKmB;AACnB,0CAAmD;AACnD,sDAQgC;AAEhC,SAAgB,eAAe,CAAC,IAAU;IACxC,MAAM,YAAY,GAA2B,EAAE,CAAA;IAC/C,MAAM,eAAe,GAA2B,EAAE,CAAA;IAElD,0EAA0E;IAC1E,8EAA8E;IAC9E,gGAAgG;IAChG,2EAA2E;IAC3E,MAAM,WAAW,GAAG,IAAA,iBAAQ,EAAC,IAAI,EAAE,cAAc,CAAC,CAAA,CAAC,uBAAuB;IAE1E,SAAS,yBAAyB,CAChC,WAAmB,EACnB,cAAsB;QAEtB,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE;YAC1C,YAAY,CAAC,WAAW,CAAC,GAAG,cAAc,CAAA;SAC3C;IACH,CAAC;IACD,SAAS,4BAA4B,CACnC,WAAmB,EACnB,cAAsB;QAEtB,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,WAAW,CAAC,EAAE;YAC7C,eAAe,CAAC,WAAW,CAAC,GAAG,cAAc,CAAA;SAC9C;IACH,CAAC;IAED,wBAAwB;IACxB,yBAAyB,CAAC,UAAU,EAAE,0BAAe,CAAC,CAAA;IACtD,yBAAyB,CAAC,gBAAgB,EAAE,+BAAoB,CAAC,CAAA;IACjE,yBAAyB,CAAC,oBAAoB,EAAE,mCAAwB,CAAC,CAAA;IAEzE,4DAA4D;IAC5D,kDAAkD;IAElD,4BAA4B;IAC5B,4BAA4B,CAAC,gBAAgB,EAAE,+BAAoB,CAAC,CAAA;IACpE,4BAA4B,CAC1B,yBAAyB,EACzB,uCAA4B,CAC7B,CAAA;IAED,2EAA2E;IAC3E,8CAA8C;IAC9C,4BAA4B,CAAC,WAAW,EAAE,0BAAe,CAAC,CAAA;IAE1D,6EAA6E;IAC7E,2GAA2G;IAC3G,QAAQ;IACR,yHAAyH;IACzH,EAAE;IAEF,qGAAqG;IACrG,8FAA8F;IAC9F,uCAAuC;IACvC,4BAA4B,CAAC,YAAY,EAAE,0BAAkB,CAAC,OAAO,CAAC,CAAA;IAEtE,iFAAiF;IACjF,4BAA4B,CAAC,UAAU,EAAE,0BAAkB,CAAC,OAAO,CAAC,CAAA;IACpE,4BAA4B,CAAC,YAAY,EAAE,0BAAkB,CAAC,OAAO,CAAC,CAAA;IACtE,4BAA4B,CAAC,UAAU,EAAE,0BAAkB,CAAC,OAAO,CAAC,CAAA;IACpE,4BAA4B,CAAC,aAAa,EAAE,0BAAkB,CAAC,OAAO,CAAC,CAAA;IACvE,4BAA4B,CAAC,QAAQ,EAAE,0BAAkB,CAAC,OAAO,CAAC,CAAA;IAElE,OAAO,IAAA,qCAA4B,EAAC,IAAI,EAAE,YAAY,EAAE,eAAe,CAAC,CAAA;AAC1E,CAAC;AAjED,0CAiEC"}
1
+ {"version":3,"file":"add-dependencies.js","sourceRoot":"","sources":["../../../../../../../packages/nx-firebase/src/generators/init/lib/add-dependencies.ts"],"names":[],"mappings":";;;AAAA,uCAOmB;AACnB,0CAAmD;AACnD,sFAA6E;AAE7E,SAAgB,eAAe,CAAC,IAAU;IACxC,MAAM,YAAY,GAA2B,EAAE,CAAA;IAC/C,MAAM,eAAe,GAA2B,EAAE,CAAA;IAElD,0EAA0E;IAC1E,8EAA8E;IAC9E,gGAAgG;IAChG,2EAA2E;IAC3E,MAAM,WAAW,GAAG,IAAA,iBAAQ,EAAC,IAAI,EAAE,cAAc,CAAC,CAAA;IAElD,SAAS,yBAAyB,CAChC,WAAmB,EACnB,cAAsB;QAEtB,IAAI,CAAC,WAAW,CAAC,YAAY,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE;YACvE,YAAY,CAAC,WAAW,CAAC,GAAG,cAAc,CAAA;YAC1C,OAAO,IAAI,CAAA;SACZ;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IACD,SAAS,4BAA4B,CACnC,WAAmB,EACnB,cAAsB;QAEtB,IACE,CAAC,WAAW,CAAC,eAAe;YAC5B,CAAC,WAAW,CAAC,eAAe,CAAC,WAAW,CAAC,EACzC;YACA,eAAe,CAAC,WAAW,CAAC,GAAG,cAAc,CAAA;YAC7C,OAAO,IAAI,CAAA;SACZ;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IAED,kDAAkD;IAClD,mEAAmE;IACnE,yBAAyB,CAAC,UAAU,EAAE,IAAI,sCAAe,CAAC,QAAQ,EAAE,CAAC,CAAA;IACrE,yBAAyB,CACvB,gBAAgB,EAChB,IAAI,sCAAe,CAAC,aAAa,EAAE,CACpC,CAAA;IACD,yBAAyB,CACvB,oBAAoB,EACpB,IAAI,sCAAe,CAAC,iBAAiB,EAAE,CACxC,CAAA;IAED,2FAA2F;IAC3F,IAAI,IAAA,6BAAoB,GAAE,KAAK,MAAM,EAAE;QACrC,IACE,yBAAyB,CACvB,mCAAmC,EACnC,IAAI,sCAAe,CAAC,6BAA6B,EAAE,CACpD,EACD;YACA,eAAM,CAAC,IAAI,CACT,kNAAkN,CACnN,CAAA;SACF;KACF;IAED,4BAA4B;IAC5B,4BAA4B,CAC1B,gBAAgB,EAChB,IAAI,sCAAe,CAAC,aAAa,EAAE,CACpC,CAAA;IACD,4BAA4B,CAC1B,yBAAyB,EACzB,IAAI,sCAAe,CAAC,qBAAqB,EAAE,CAC5C,CAAA;IAED,2EAA2E;IAC3E,8CAA8C;IAC9C,4BAA4B,CAAC,WAAW,EAAE,IAAI,sCAAe,CAAC,QAAQ,EAAE,CAAC,CAAA;IAEzE,6FAA6F;IAC7F,4FAA4F;IAC5F,mGAAmG;IACnG,sHAAsH;IACtH,4BAA4B,CAAC,UAAU,EAAE,0BAAkB,CAAC,OAAO,CAAC,CAAA;IACpE,OAAO,IAAA,qCAA4B,EAAC,IAAI,EAAE,YAAY,EAAE,eAAe,CAAC,CAAA;AAC1E,CAAC;AAhFD,0CAgFC"}
@@ -1,3 +1,2 @@
1
1
  export * from './add-dependencies';
2
- export * from './normalize-options';
3
2
  export * from './add-git-ignore-entry';
@@ -2,6 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./add-dependencies"), exports);
5
- tslib_1.__exportStar(require("./normalize-options"), exports);
6
5
  tslib_1.__exportStar(require("./add-git-ignore-entry"), exports);
7
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/nx-firebase/src/generators/init/lib/index.ts"],"names":[],"mappings":";;;AAAA,6DAAkC;AAClC,8DAAmC;AACnC,iEAAsC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/nx-firebase/src/generators/init/lib/index.ts"],"names":[],"mappings":";;;AAAA,6DAAkC;AAClC,iEAAsC"}
@@ -1,6 +1,3 @@
1
- export interface InitGeneratorOptions {
2
- unitTestRunner?: 'jest' | 'none'
1
+ export type InitGeneratorOptions = {
3
2
  skipFormat?: boolean
4
- js?: boolean
5
- rootProject?: boolean
6
3
  }
@@ -5,21 +5,10 @@
5
5
  "description": "Init Firebase Plugin.",
6
6
  "type": "object",
7
7
  "properties": {
8
- "unitTestRunner": {
9
- "description": "Adds the specified unit test runner.",
10
- "type": "string",
11
- "enum": ["jest", "none"],
12
- "default": "jest"
13
- },
14
8
  "skipFormat": {
15
9
  "description": "Skip formatting files.",
16
10
  "type": "boolean",
17
11
  "default": false
18
- },
19
- "js": {
20
- "type": "boolean",
21
- "default": false,
22
- "description": "Use JavaScript instead of TypeScript"
23
12
  }
24
13
  },
25
14
  "required": []
@@ -3,7 +3,6 @@
3
3
  "$id": "Migrate",
4
4
  "title": "",
5
5
  "type": "object",
6
- "properties": {
7
- },
6
+ "properties": {},
8
7
  "required": []
9
8
  }
@@ -1,4 +1,3 @@
1
- export * from './versions';
2
1
  export * from './workspace';
3
2
  export * from './update-tsconfig';
4
3
  export * from './project-name';
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./versions"), exports);
5
4
  tslib_1.__exportStar(require("./workspace"), exports);
6
5
  tslib_1.__exportStar(require("./update-tsconfig"), exports);
7
6
  tslib_1.__exportStar(require("./project-name"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/nx-firebase/src/utils/index.ts"],"names":[],"mappings":";;;AAAA,qDAA0B;AAC1B,sDAA2B;AAC3B,4DAAiC;AACjC,yDAA8B;AAC9B,4DAAiC;AACjC,kDAAuB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/nx-firebase/src/utils/index.ts"],"names":[],"mappings":";;;AAAA,sDAA2B;AAC3B,4DAAiC;AACjC,yDAA8B;AAC9B,4DAAiC;AACjC,kDAAuB"}
@@ -1,4 +1,5 @@
1
1
  import type { Tree } from '@nx/devkit';
2
+ export declare const nodeEsVersion: Record<string, string>;
2
3
  /**
3
4
  * With firebase cli > 10.0.1 now compatible with node versions >=14 we can use es modules rather than commonjs
4
5
  *
@@ -1,8 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateTsConfig = void 0;
3
+ exports.updateTsConfig = exports.nodeEsVersion = void 0;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const versions_1 = require("./versions");
5
+ const nx_firebase_versions_1 = require("../__generated__/nx-firebase-versions");
6
+ // https://stackoverflow.com/questions/59787574/typescript-tsconfig-settings-for-node-js-12
7
+ exports.nodeEsVersion = {
8
+ '12': 'es2019',
9
+ '14': 'es2020',
10
+ '16': 'es2020',
11
+ '18': 'es2022',
12
+ '20': 'es2022',
13
+ };
6
14
  /**
7
15
  * With firebase cli > 10.0.1 now compatible with node versions >=14 we can use es modules rather than commonjs
8
16
  *
@@ -10,8 +18,10 @@ const versions_1 = require("./versions");
10
18
  * @param options
11
19
  */
12
20
  function updateTsConfig(tree, projectRoot, runTime, format) {
21
+ var _a;
22
+ const tsConfigTarget = (_a = exports.nodeEsVersion[runTime]) !== null && _a !== void 0 ? _a : exports.nodeEsVersion[nx_firebase_versions_1.packageVersions.nodeEngine];
13
23
  (0, devkit_1.updateJson)(tree, (0, devkit_1.joinPathFragments)(projectRoot, 'tsconfig.app.json'), (json) => {
14
- json.compilerOptions.target = versions_1.nodeEsVersion[runTime];
24
+ json.compilerOptions.target = tsConfigTarget;
15
25
  json.compilerOptions.module = format === 'esm' ? 'es2020' : 'commonjs';
16
26
  return json;
17
27
  });
@@ -1 +1 @@
1
- {"version":3,"file":"update-tsconfig.js","sourceRoot":"","sources":["../../../../../packages/nx-firebase/src/utils/update-tsconfig.ts"],"names":[],"mappings":";;;AACA,uCAA0D;AAC1D,yCAA0C;AAE1C;;;;;GAKG;AACH,SAAgB,cAAc,CAC5B,IAAU,EACV,WAAmB,EACnB,OAAe,EACf,MAAqB;IAErB,IAAA,mBAAU,EACR,IAAI,EACJ,IAAA,0BAAiB,EAAC,WAAW,EAAE,mBAAmB,CAAC,EACnD,CAAC,IAAI,EAAE,EAAE;QACP,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,wBAAa,CAAC,OAAO,CAAC,CAAA;QACpD,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAA;QACtE,OAAO,IAAI,CAAA;IACb,CAAC,CACF,CAAA;AACH,CAAC;AAfD,wCAeC"}
1
+ {"version":3,"file":"update-tsconfig.js","sourceRoot":"","sources":["../../../../../packages/nx-firebase/src/utils/update-tsconfig.ts"],"names":[],"mappings":";;;AACA,uCAA0D;AAC1D,gFAAuE;AAEvE,2FAA2F;AAE9E,QAAA,aAAa,GAA2B;IACnD,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;CACf,CAAA;AAED;;;;;GAKG;AACH,SAAgB,cAAc,CAC5B,IAAU,EACV,WAAmB,EACnB,OAAe,EACf,MAAqB;;IAErB,MAAM,cAAc,GAClB,MAAA,qBAAa,CAAC,OAAO,CAAC,mCAAI,qBAAa,CAAC,sCAAe,CAAC,UAAU,CAAC,CAAA;IACrE,IAAA,mBAAU,EACR,IAAI,EACJ,IAAA,0BAAiB,EAAC,WAAW,EAAE,mBAAmB,CAAC,EACnD,CAAC,IAAI,EAAE,EAAE;QACP,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,cAAc,CAAA;QAC5C,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAA;QACtE,OAAO,IAAI,CAAA;IACb,CAAC,CACF,CAAA;AACH,CAAC;AAjBD,wCAiBC"}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.checkNxVersion = exports.workspaceNxVersion = void 0;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const versions_1 = require("./versions");
5
+ const nx_firebase_versions_1 = require("../__generated__/nx-firebase-versions");
6
6
  function readNxWorkspaceVersion() {
7
7
  // Check the runtime Nx version being used by the current workspace
8
8
  const semVerRegEx = /[~^]?([\dvx*]+(?:[-.](?:[\dx*]+|alpha|beta))*)/g;
@@ -28,9 +28,11 @@ function readNxWorkspaceVersion() {
28
28
  // determine the Nx version being used by the host workspace
29
29
  exports.workspaceNxVersion = readNxWorkspaceVersion();
30
30
  function checkNxVersion() {
31
+ // Declare target version of Nx that the plugin is currently compatible with
32
+ const pluginNxVersionMajor = parseInt(nx_firebase_versions_1.packageVersions.nx.split('.')[0]);
31
33
  if (exports.workspaceNxVersion) {
32
- if (exports.workspaceNxVersion.major > versions_1.pluginNxVersionMajor) {
33
- devkit_1.logger.warn(`WARNING: @simondotm/nx-firebase plugin for Nx version (${versions_1.pluginNxVersion}) may not be compatible with your version of Nx (${exports.workspaceNxVersion.version})`);
34
+ if (exports.workspaceNxVersion.major !== pluginNxVersionMajor) {
35
+ devkit_1.logger.warn(`WARNING: This version of @simondotm/nx-firebase plugin was built for Nx version ^${nx_firebase_versions_1.packageVersions.nx}, and may not be compatible with your version of Nx (${exports.workspaceNxVersion.version})`);
34
36
  }
35
37
  }
36
38
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../../../../packages/nx-firebase/src/utils/workspace.ts"],"names":[],"mappings":";;;AAAA,uCAAgE;AAChE,yCAAkE;AAqBlE,SAAS,sBAAsB;IAC7B,mEAAmE;IACnE,MAAM,WAAW,GAAG,iDAAiD,CAAA;IACrE,MAAM,gBAAgB,GAAG,IAAA,qBAAY,EACnC,GAAG,sBAAa,eAAe,CAChC,CAAA;IACD,MAAM,yBAAyB,GAAG,gBAAgB,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;IACxE,IAAI,yBAAyB,EAAE;QAC7B,MAAM,kBAAkB,GAAG,yBAAyB,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;QACvE,IAAI,kBAAkB,CAAC,MAAM,EAAE;YAC7B,MAAM,MAAM,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YAC/C,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;YACjC,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;YACjC,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;YACjC,OAAO;gBACL,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC;gBAC9B,WAAW,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,GAAG,GAAG,KAAK;gBAChD,KAAK;gBACL,KAAK;aACN,CAAA;SACF;KACF;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,4DAA4D;AAC/C,QAAA,kBAAkB,GAAG,sBAAsB,EAAE,CAAA;AAE1D,SAAgB,cAAc;IAC5B,IAAI,0BAAkB,EAAE;QACtB,IAAI,0BAAkB,CAAC,KAAK,GAAG,+BAAoB,EAAE;YACnD,eAAM,CAAC,IAAI,CACT,0DAA0D,0BAAe,oDAAoD,0BAAkB,CAAC,OAAO,GAAG,CAC3J,CAAA;SACF;KACF;SAAM;QACL,eAAM,CAAC,IAAI,CACT,iGAAiG,CAClG,CAAA;KACF;AACH,CAAC;AAZD,wCAYC"}
1
+ {"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../../../../packages/nx-firebase/src/utils/workspace.ts"],"names":[],"mappings":";;;AAAA,uCAAgE;AAChE,gFAAuE;AAqBvE,SAAS,sBAAsB;IAC7B,mEAAmE;IACnE,MAAM,WAAW,GAAG,iDAAiD,CAAA;IACrE,MAAM,gBAAgB,GAAG,IAAA,qBAAY,EACnC,GAAG,sBAAa,eAAe,CAChC,CAAA;IACD,MAAM,yBAAyB,GAAG,gBAAgB,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;IACxE,IAAI,yBAAyB,EAAE;QAC7B,MAAM,kBAAkB,GAAG,yBAAyB,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;QACvE,IAAI,kBAAkB,CAAC,MAAM,EAAE;YAC7B,MAAM,MAAM,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YAC/C,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;YACjC,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;YACjC,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;YACjC,OAAO;gBACL,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC;gBAC9B,WAAW,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,GAAG,GAAG,KAAK;gBAChD,KAAK;gBACL,KAAK;aACN,CAAA;SACF;KACF;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,4DAA4D;AAC/C,QAAA,kBAAkB,GAAG,sBAAsB,EAAE,CAAA;AAE1D,SAAgB,cAAc;IAC5B,4EAA4E;IAC5E,MAAM,oBAAoB,GAAG,QAAQ,CAAC,sCAAe,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACvE,IAAI,0BAAkB,EAAE;QACtB,IAAI,0BAAkB,CAAC,KAAK,KAAK,oBAAoB,EAAE;YACrD,eAAM,CAAC,IAAI,CACT,oFAAoF,sCAAe,CAAC,EAAE,wDAAwD,0BAAkB,CAAC,OAAO,GAAG,CAC5L,CAAA;SACF;KACF;SAAM;QACL,eAAM,CAAC,IAAI,CACT,iGAAiG,CAClG,CAAA;KACF;AACH,CAAC;AAdD,wCAcC"}
@@ -1,2 +0,0 @@
1
- import type { InitGeneratorOptions } from '../schema';
2
- export declare function normalizeOptions(options: InitGeneratorOptions): InitGeneratorOptions;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.normalizeOptions = void 0;
4
- function normalizeOptions(options) {
5
- var _a;
6
- return Object.assign(Object.assign({}, options), { unitTestRunner: (_a = options.unitTestRunner) !== null && _a !== void 0 ? _a : 'jest' });
7
- }
8
- exports.normalizeOptions = normalizeOptions;
9
- //# sourceMappingURL=normalize-options.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/nx-firebase/src/generators/init/lib/normalize-options.ts"],"names":[],"mappings":";;;AAEA,SAAgB,gBAAgB,CAC9B,OAA6B;;IAE7B,uCACK,OAAO,KACV,cAAc,EAAE,MAAA,OAAO,CAAC,cAAc,mCAAI,MAAM,IACjD;AACH,CAAC;AAPD,4CAOC"}
@@ -1,13 +0,0 @@
1
- export declare const pluginNxVersion = "^16.1.1";
2
- export declare const pluginNxVersionMajor = 16;
3
- export declare const tsLibVersion = "^2.0.0";
4
- export declare const firebaseAdminVersion = "^11.10.1";
5
- export declare const firebaseFunctionsVersion = "^4.4.1";
6
- export declare const firebaseToolsVersion = "^12.4.5";
7
- export declare const firebaseVersion = "^9.14.0";
8
- export declare const firebaseFunctionsTestVersion = "^3.1.0";
9
- export declare const firebaseNodeEngine = "16";
10
- export declare const firebaseNodeRuntime: string;
11
- export declare const nodeEsVersion: Record<string, string>;
12
- export declare const tsConfigTarget: string;
13
- export declare const killportVersion = "^2.0.1";
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.killportVersion = exports.tsConfigTarget = exports.nodeEsVersion = exports.firebaseNodeRuntime = exports.firebaseNodeEngine = exports.firebaseFunctionsTestVersion = exports.firebaseVersion = exports.firebaseToolsVersion = exports.firebaseFunctionsVersion = exports.firebaseAdminVersion = exports.tsLibVersion = exports.pluginNxVersionMajor = exports.pluginNxVersion = void 0;
4
- // Declare target version of Nx that the plugin is currently compatible with
5
- exports.pluginNxVersion = '^16.1.1';
6
- exports.pluginNxVersionMajor = 16;
7
- // Tslib version changes with each Nx version
8
- exports.tsLibVersion = '^2.0.0';
9
- // Firebase packages are not managed by the plugin
10
- // but they are added if they do not exist already in the workspace
11
- exports.firebaseAdminVersion = '^11.10.1';
12
- exports.firebaseFunctionsVersion = '^4.4.1';
13
- exports.firebaseToolsVersion = '^12.4.5';
14
- exports.firebaseVersion = '^9.14.0';
15
- exports.firebaseFunctionsTestVersion = '^3.1.0';
16
- // Target node 16 for all firebase projects now
17
- exports.firebaseNodeEngine = '16';
18
- exports.firebaseNodeRuntime = `nodejs${exports.firebaseNodeEngine}`;
19
- // https://stackoverflow.com/questions/59787574/typescript-tsconfig-settings-for-node-js-12
20
- exports.nodeEsVersion = {
21
- '12': 'es2019',
22
- '14': 'es2020',
23
- '16': 'es2020',
24
- '18': 'es2022',
25
- '20': 'es2022',
26
- };
27
- exports.tsConfigTarget = exports.nodeEsVersion[exports.firebaseNodeEngine];
28
- if (!exports.tsConfigTarget) {
29
- throw new Error('Undefined tsConfigTarget');
30
- }
31
- // kill-port is used by the emulator/serve target
32
- exports.killportVersion = '^2.0.1';
33
- //# sourceMappingURL=versions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../../../packages/nx-firebase/src/utils/versions.ts"],"names":[],"mappings":";;;AAAA,4EAA4E;AAC/D,QAAA,eAAe,GAAG,SAAS,CAAA;AAC3B,QAAA,oBAAoB,GAAG,EAAE,CAAA;AAEtC,6CAA6C;AAChC,QAAA,YAAY,GAAG,QAAQ,CAAA;AAEpC,kDAAkD;AAClD,mEAAmE;AACtD,QAAA,oBAAoB,GAAG,UAAU,CAAA;AACjC,QAAA,wBAAwB,GAAG,QAAQ,CAAA;AACnC,QAAA,oBAAoB,GAAG,SAAS,CAAA;AAChC,QAAA,eAAe,GAAG,SAAS,CAAA;AAC3B,QAAA,4BAA4B,GAAG,QAAQ,CAAA;AAEpD,+CAA+C;AAClC,QAAA,kBAAkB,GAAG,IAAI,CAAA;AACzB,QAAA,mBAAmB,GAAG,SAAS,0BAAkB,EAAE,CAAA;AAEhE,2FAA2F;AAE9E,QAAA,aAAa,GAA2B;IACnD,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,cAAc,GAAG,qBAAa,CAAC,0BAAkB,CAAC,CAAA;AAE/D,IAAI,CAAC,sBAAc,EAAE;IACnB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;CAC5C;AAED,iDAAiD;AACpC,QAAA,eAAe,GAAG,QAAQ,CAAA"}