@simondotm/nx-firebase 20.8.4 → 22.3.3
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.
- package/package.json +4 -4
- package/src/__generated__/nx-firebase-versions.js +3 -3
- package/src/__generated__/nx-firebase-versions.js.map +1 -1
- package/src/generators/application/files/firestore.indexes.json +26 -1
- package/src/generators/application/files/firestore.rules +2 -0
- package/src/generators/function/files/src/main.ts__tmpl__ +14 -1
- package/src/generators/function/lib/update-project.js +5 -1
- package/src/generators/function/lib/update-project.js.map +1 -1
- package/src/generators/function/schema.d.ts +1 -1
- package/src/generators/function/schema.json +2 -2
- package/src/utils/update-tsconfig.js +2 -3
- package/src/utils/update-tsconfig.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simondotm/nx-firebase",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "22.3.3",
|
|
4
4
|
"description": "A Firebase plugin for Nx monorepo workspaces.",
|
|
5
5
|
"author": "Simon Morris",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"generators": "./generators.json",
|
|
22
22
|
"executors": "./executors.json",
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@nx/devkit": ">=
|
|
25
|
-
"@nx/workspace": ">=
|
|
26
|
-
"nx": ">=
|
|
24
|
+
"@nx/devkit": ">= 22.3.3",
|
|
25
|
+
"@nx/workspace": ">= 22.3.3",
|
|
26
|
+
"nx": ">= 22.3.3"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {},
|
|
29
29
|
"types": "./src/index.d.ts",
|
|
@@ -6,14 +6,14 @@ exports.packageVersions = void 0;
|
|
|
6
6
|
// Do not edit this file manually
|
|
7
7
|
//------------------------------------------------------------------------------
|
|
8
8
|
exports.packageVersions = {
|
|
9
|
-
nx: '
|
|
9
|
+
nx: '22.3.3',
|
|
10
10
|
firebase: '12.8.0',
|
|
11
11
|
firebaseAdmin: '13.6.0',
|
|
12
12
|
firebaseFunctions: '7.0.3',
|
|
13
13
|
firebaseFunctionsTest: '3.4.1',
|
|
14
|
-
firebaseTools: '
|
|
14
|
+
firebaseTools: '15.3.1',
|
|
15
15
|
killPort: '2.0.1',
|
|
16
|
-
nodeEngine: '
|
|
16
|
+
nodeEngine: '20',
|
|
17
17
|
googleCloudFunctionsFramework: '3.3.0',
|
|
18
18
|
};
|
|
19
19
|
//# sourceMappingURL=nx-firebase-versions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nx-firebase-versions.js","sourceRoot":"","sources":["../../../../../packages/nx-firebase/src/__generated__/nx-firebase-versions.ts"],"names":[],"mappings":";;;AAAA,gFAAgF;AAChF,6EAA6E;AAC7E,iCAAiC;AACjC,gFAAgF;AACnE,QAAA,eAAe,GAAG;IAC7B,EAAE,EAAE,QAAQ;IACZ,QAAQ,EAAE,QAAQ;IAClB,aAAa,EAAE,QAAQ;IACvB,iBAAiB,EAAE,OAAO;IAC1B,qBAAqB,EAAE,OAAO;IAC9B,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"nx-firebase-versions.js","sourceRoot":"","sources":["../../../../../packages/nx-firebase/src/__generated__/nx-firebase-versions.ts"],"names":[],"mappings":";;;AAAA,gFAAgF;AAChF,6EAA6E;AAC7E,iCAAiC;AACjC,gFAAgF;AACnE,QAAA,eAAe,GAAG;IAC7B,EAAE,EAAE,QAAQ;IACZ,QAAQ,EAAE,QAAQ;IAClB,aAAa,EAAE,QAAQ;IACvB,iBAAiB,EAAE,OAAO;IAC1B,qBAAqB,EAAE,OAAO;IAC9B,aAAa,EAAE,QAAQ;IACvB,QAAQ,EAAE,OAAO;IACjB,UAAU,EAAE,IAAI;IAChB,6BAA6B,EAAE,OAAO;CACvC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
// Example:
|
|
2
|
+
// Example (Standard Edition):
|
|
3
3
|
//
|
|
4
4
|
// "indexes": [
|
|
5
5
|
// {
|
|
@@ -21,6 +21,31 @@
|
|
|
21
21
|
// },
|
|
22
22
|
// ]
|
|
23
23
|
// ]
|
|
24
|
+
//
|
|
25
|
+
// Example (Enterprise Edition):
|
|
26
|
+
//
|
|
27
|
+
// "indexes": [
|
|
28
|
+
// {
|
|
29
|
+
// "collectionGroup": "reviews",
|
|
30
|
+
// "queryScope": "COLLECTION_GROUP",
|
|
31
|
+
// "apiScope": "MONGODB_COMPATIBLE_API",
|
|
32
|
+
// "density": "DENSE",
|
|
33
|
+
// "multikey": false,
|
|
34
|
+
// "fields": [
|
|
35
|
+
// { "fieldPath": "baz", "mode": "ASCENDING" }
|
|
36
|
+
// ]
|
|
37
|
+
// },
|
|
38
|
+
// {
|
|
39
|
+
// "collectionGroup": "items",
|
|
40
|
+
// "queryScope": "COLLECTION_GROUP",
|
|
41
|
+
// "apiScope": "MONGODB_COMPATIBLE_API",
|
|
42
|
+
// "density": "SPARSE_ANY",
|
|
43
|
+
// "multikey": true,
|
|
44
|
+
// "fields": [
|
|
45
|
+
// { "fieldPath": "baz", "mode": "ASCENDING" }
|
|
46
|
+
// ]
|
|
47
|
+
// },
|
|
48
|
+
// ]
|
|
24
49
|
"indexes": [],
|
|
25
50
|
"fieldOverrides": []
|
|
26
51
|
}
|
|
@@ -7,12 +7,25 @@
|
|
|
7
7
|
* See a full list of supported triggers at https://firebase.google.com/docs/functions
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import {setGlobalOptions} from "firebase-functions";
|
|
11
|
+
import {onRequest} from "firebase-functions/https";
|
|
11
12
|
import * as logger from "firebase-functions/logger";
|
|
12
13
|
|
|
13
14
|
// Start writing functions
|
|
14
15
|
// https://firebase.google.com/docs/functions/typescript
|
|
15
16
|
|
|
17
|
+
// For cost control, you can set the maximum number of containers that can be
|
|
18
|
+
// running at the same time. This helps mitigate the impact of unexpected
|
|
19
|
+
// traffic spikes by instead downgrading performance. This limit is a
|
|
20
|
+
// per-function limit. You can override the limit for each function using the
|
|
21
|
+
// `maxInstances` option in the function's options, e.g.
|
|
22
|
+
// `onRequest({ maxInstances: 5 }, (req, res) => { ... })`.
|
|
23
|
+
// NOTE: setGlobalOptions does not apply to functions using the v1 API. V1
|
|
24
|
+
// functions should each use functions.runWith({ maxInstances: 10 }) instead.
|
|
25
|
+
// In the v1 API, each function can only serve one request per container, so
|
|
26
|
+
// this will be the maximum concurrent request count.
|
|
27
|
+
setGlobalOptions({ maxInstances: 10 });
|
|
28
|
+
|
|
16
29
|
// export const helloWorld = onRequest((request, response) => {
|
|
17
30
|
// logger.info("Hello logs!", {structuredData: true});
|
|
18
31
|
// response.send("Hello from Firebase!");
|
|
@@ -60,11 +60,15 @@ function updateProject(host, options) {
|
|
|
60
60
|
// when running the firebase app's test target. passWithNoTests is a CLI option,
|
|
61
61
|
// not a jest.config option, so we need to set it in the target.
|
|
62
62
|
// In Nx 18+, the test target may not exist (inferred by plugin), so we create it.
|
|
63
|
+
// Nx 22+ creates jest.config.cts for ESM projects, so we check which file exists
|
|
64
|
+
const jestConfigFile = host.exists(`${options.projectRoot}/jest.config.cts`)
|
|
65
|
+
? 'jest.config.cts'
|
|
66
|
+
: 'jest.config.ts';
|
|
63
67
|
project.targets.test = {
|
|
64
68
|
executor: '@nx/jest:jest',
|
|
65
69
|
outputs: ['{workspaceRoot}/coverage/{projectRoot}'],
|
|
66
70
|
options: {
|
|
67
|
-
jestConfig: `${options.projectRoot}
|
|
71
|
+
jestConfig: `${options.projectRoot}/${jestConfigFile}`,
|
|
68
72
|
passWithNoTests: true,
|
|
69
73
|
},
|
|
70
74
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-project.js","sourceRoot":"","sources":["../../../../../../../packages/nx-firebase/src/generators/function/lib/update-project.ts"],"names":[],"mappings":";;AAQA,
|
|
1
|
+
{"version":3,"file":"update-project.js","sourceRoot":"","sources":["../../../../../../../packages/nx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AAoB,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;IACjE,kBAAkB,CAAC,oBAAoB,CAAC,IAAI,EAAE,CAAA;IAC9C,IAAA,mCAA0B,EAAC,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAA;AACnE,CAAC"}
|
|
@@ -6,11 +6,10 @@ const devkit_1 = require("@nx/devkit");
|
|
|
6
6
|
const nx_firebase_versions_1 = require("../__generated__/nx-firebase-versions");
|
|
7
7
|
// https://stackoverflow.com/questions/59787574/typescript-tsconfig-settings-for-node-js-12
|
|
8
8
|
exports.nodeEsVersion = {
|
|
9
|
-
'12': 'es2019',
|
|
10
|
-
'14': 'es2020',
|
|
11
|
-
'16': 'es2020', // es2020 seems more preferred with node 16 than es2021
|
|
12
9
|
'18': 'es2022',
|
|
13
10
|
'20': 'es2022',
|
|
11
|
+
'22': 'es2023',
|
|
12
|
+
'24': 'es2024',
|
|
14
13
|
};
|
|
15
14
|
/**
|
|
16
15
|
* With firebase cli > 10.0.1 now compatible with node versions >=14 we can use es modules rather than commonjs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-tsconfig.js","sourceRoot":"","sources":["../../../../../packages/nx-firebase/src/utils/update-tsconfig.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"update-tsconfig.js","sourceRoot":"","sources":["../../../../../packages/nx-firebase/src/utils/update-tsconfig.ts"],"names":[],"mappings":";;;AAkBA,wCAiBC;AAnCD,uCAAqE;AACrE,gFAAuE;AAEvE,2FAA2F;AAE9E,QAAA,aAAa,GAA2B;IACnD,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"}
|