firebase-tools-with-isolate 13.27.0 → 13.29.1-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.
- package/lib/appdistribution/client.js +2 -1
- package/lib/appdistribution/options-parser-util.js +5 -5
- package/lib/auth.js +13 -3
- package/lib/bin/firebase.js +4 -3
- package/lib/commands/appdistribution-distribute.js +55 -31
- package/lib/commands/firestore-indexes-list.js +4 -2
- package/lib/commands/index.js +2 -2
- package/lib/dataconnect/fileUtils.js +3 -0
- package/lib/dataconnect/schemaMigration.js +10 -16
- package/lib/dataconnect/types.js +1 -1
- package/lib/deploy/extensions/tasks.js +2 -2
- package/lib/deploy/functions/backend.js +1 -3
- package/lib/deploy/functions/build.js +3 -1
- package/lib/deploy/functions/prepare.js +1 -1
- package/lib/deploy/functions/prepareFunctionsUpload.js +9 -5
- package/lib/deploy/functions/release/planner.js +4 -4
- package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +4 -0
- package/lib/deploy/functions/runtimes/supported/types.js +1 -1
- package/lib/emulator/apphosting/developmentServer.js +1 -1
- package/lib/emulator/apphosting/index.js +1 -1
- package/lib/emulator/auth/operations.js +8 -5
- package/lib/emulator/controller.js +20 -1
- package/lib/emulator/dataconnect/pgliteServer.js +36 -12
- package/lib/emulator/dataconnectEmulator.js +18 -1
- package/lib/emulator/downloadableEmulators.js +21 -10
- package/lib/emulator/eventarcEmulator.js +1 -0
- package/lib/emulator/initEmulators.js +17 -2
- package/lib/error.js +11 -1
- package/lib/experiments.js +0 -6
- package/lib/extensions/localHelper.js +2 -2
- package/lib/extensions/runtimes/node.js +16 -15
- package/lib/extensions/types.js +6 -9
- package/lib/functions/events/v2.js +7 -3
- package/lib/gcp/cloudfunctionsv2.js +6 -0
- package/lib/init/features/dataconnect/index.js +8 -5
- package/lib/init/features/emulators.js +1 -1
- package/lib/init/features/genkit/index.js +13 -5
- package/lib/init/spawn.js +37 -7
- package/lib/management/projects.js +23 -1
- package/lib/requireAuth.js +2 -1
- package/package.json +7 -3
- package/schema/firebase-config.json +3 -0
- package/templates/init/dataconnect/dataconnect.yaml +1 -0
- package/templates/init/functions/javascript/package.lint.json +1 -1
- package/templates/init/functions/javascript/package.nolint.json +1 -1
- package/templates/init/functions/typescript/package.lint.json +1 -1
- package/templates/init/functions/typescript/package.nolint.json +1 -1
- package/templates/init/functions/typescript/tsconfig.json +3 -1
- package/templates/init/dataconnect/dataconnect-fdccompatiblemode.yaml +0 -12
package/lib/init/spawn.js
CHANGED
|
@@ -1,27 +1,57 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.spawnWithCommandString = exports.wrapSpawn = void 0;
|
|
3
|
+
exports.spawnWithCommandString = exports.spawnWithOutput = exports.wrapSpawn = void 0;
|
|
4
4
|
const spawn = require("cross-spawn");
|
|
5
5
|
const logger_1 = require("../logger");
|
|
6
|
-
|
|
6
|
+
const error_1 = require("../error");
|
|
7
|
+
function wrapSpawn(cmd, args, projectDir) {
|
|
7
8
|
return new Promise((resolve, reject) => {
|
|
8
9
|
const installer = spawn(cmd, args, {
|
|
9
10
|
cwd: projectDir,
|
|
10
11
|
stdio: "inherit",
|
|
11
|
-
env: { ...process.env
|
|
12
|
+
env: { ...process.env },
|
|
12
13
|
});
|
|
13
14
|
installer.on("error", (err) => {
|
|
14
|
-
logger_1.logger.debug(
|
|
15
|
+
logger_1.logger.debug((0, error_1.getErrStack)(err));
|
|
15
16
|
});
|
|
16
17
|
installer.on("close", (code) => {
|
|
17
18
|
if (code === 0) {
|
|
18
19
|
return resolve();
|
|
19
20
|
}
|
|
20
|
-
return reject();
|
|
21
|
+
return reject(new Error(`Error: spawn(${cmd}, [${args.join(", ")}]) \n exited with code: ${code || "null"}`));
|
|
21
22
|
});
|
|
22
23
|
});
|
|
23
24
|
}
|
|
24
25
|
exports.wrapSpawn = wrapSpawn;
|
|
26
|
+
function spawnWithOutput(cmd, args) {
|
|
27
|
+
return new Promise((resolve, reject) => {
|
|
28
|
+
const child = spawn(cmd, args);
|
|
29
|
+
let output = "";
|
|
30
|
+
child.stdout?.on("data", (data) => {
|
|
31
|
+
if ((0, error_1.isObject)(data) && data.toString) {
|
|
32
|
+
output += data.toString();
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
output += JSON.stringify(data);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
child.stderr?.on("data", (data) => {
|
|
39
|
+
logger_1.logger.debug(`Error: spawn(${cmd}, ${args.join(", ")})\n Stderr:\n${JSON.stringify(data)}\n`);
|
|
40
|
+
});
|
|
41
|
+
child.on("error", (err) => {
|
|
42
|
+
logger_1.logger.debug((0, error_1.getErrStack)(err));
|
|
43
|
+
});
|
|
44
|
+
child.on("close", (code) => {
|
|
45
|
+
if (code === 0) {
|
|
46
|
+
resolve(output);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
reject(new Error(`Error: spawn(${cmd}, [${args.join(", ")}]) \n exited with code: ${code || "null"}`));
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
exports.spawnWithOutput = spawnWithOutput;
|
|
25
55
|
function spawnWithCommandString(cmd, projectDir, environmentVariables) {
|
|
26
56
|
return new Promise((resolve, reject) => {
|
|
27
57
|
const installer = spawn(cmd, {
|
|
@@ -31,13 +61,13 @@ function spawnWithCommandString(cmd, projectDir, environmentVariables) {
|
|
|
31
61
|
env: { ...process.env, ...environmentVariables },
|
|
32
62
|
});
|
|
33
63
|
installer.on("error", (err) => {
|
|
34
|
-
logger_1.logger.log("DEBUG",
|
|
64
|
+
logger_1.logger.log("DEBUG", (0, error_1.getErrStack)(err));
|
|
35
65
|
});
|
|
36
66
|
installer.on("close", (code) => {
|
|
37
67
|
if (code === 0) {
|
|
38
68
|
return resolve();
|
|
39
69
|
}
|
|
40
|
-
return reject();
|
|
70
|
+
return reject(new Error(`Error: spawn(${cmd}) \n exited with code: ${code || "null"}`));
|
|
41
71
|
});
|
|
42
72
|
});
|
|
43
73
|
}
|
|
@@ -26,12 +26,34 @@ exports.PROJECTS_CREATE_QUESTIONS = [
|
|
|
26
26
|
default: "",
|
|
27
27
|
message: "Please specify a unique project id " +
|
|
28
28
|
`(${clc.yellow("warning")}: cannot be modified afterward) [6-30 characters]:\n`,
|
|
29
|
+
validate: (projectId) => {
|
|
30
|
+
if (projectId.length < 6) {
|
|
31
|
+
return "Project ID must be at least 6 characters long";
|
|
32
|
+
}
|
|
33
|
+
else if (projectId.length > 30) {
|
|
34
|
+
return "Project ID cannot be longer than 30 characters";
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
},
|
|
29
40
|
},
|
|
30
41
|
{
|
|
31
42
|
type: "input",
|
|
32
43
|
name: "displayName",
|
|
33
|
-
default:
|
|
44
|
+
default: (answers) => answers.projectId,
|
|
34
45
|
message: "What would you like to call your project? (defaults to your project ID)",
|
|
46
|
+
validate: (displayName) => {
|
|
47
|
+
if (displayName.length < 4) {
|
|
48
|
+
return "Project name must be at least 4 characters long";
|
|
49
|
+
}
|
|
50
|
+
else if (displayName.length > 30) {
|
|
51
|
+
return "Project name cannot be longer than 30 characters";
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
},
|
|
35
57
|
},
|
|
36
58
|
];
|
|
37
59
|
const firebaseAPIClient = new apiv2_1.Client({
|
package/lib/requireAuth.js
CHANGED
|
@@ -24,6 +24,7 @@ async function autoAuth(options, authScopes) {
|
|
|
24
24
|
const client = getAuthClient({ scopes: authScopes, projectId: options.project });
|
|
25
25
|
const token = await client.getAccessToken();
|
|
26
26
|
token !== null ? apiv2.setAccessToken(token) : false;
|
|
27
|
+
logger_1.logger.debug(`Running auto auth`);
|
|
27
28
|
let clientEmail;
|
|
28
29
|
try {
|
|
29
30
|
const credentials = await client.getCredentials();
|
|
@@ -71,7 +72,7 @@ async function requireAuth(options) {
|
|
|
71
72
|
utils.logWarning("Authenticating with `FIREBASE_TOKEN` is deprecated and will be removed in a future major version of `firebase-tools`. " +
|
|
72
73
|
"Instead, use a service account key with `GOOGLE_APPLICATION_CREDENTIALS`: https://cloud.google.com/docs/authentication/getting-started");
|
|
73
74
|
}
|
|
74
|
-
else if (user) {
|
|
75
|
+
else if (user && (!(0, auth_1.isExpired)(tokens) || tokens?.refresh_token)) {
|
|
75
76
|
logger_1.logger.debug(`> authorizing via signed-in user (${user.email})`);
|
|
76
77
|
}
|
|
77
78
|
else {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "firebase-tools-with-isolate",
|
|
3
3
|
"description": "Command-Line Interface for Firebase with monorepo support",
|
|
4
|
-
"version": "13.
|
|
4
|
+
"version": "13.29.1-0",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"firebase": "lib/bin/firebase.js"
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"test:client-integration": "bash ./scripts/client-integration-tests/run.sh",
|
|
30
30
|
"test:compile": "tsc --project tsconfig.compile.json",
|
|
31
31
|
"test:dataconnect-deploy": "bash ./scripts/dataconnect-test/run.sh",
|
|
32
|
+
"test:dataconnect-emulator": "bash ./scripts/dataconnect-emulator-tests/run.sh",
|
|
32
33
|
"test:all-emulators": "npm run test:emulator && npm run test:extensions-emulator && npm run test:import-export && npm run test:storage-emulator-integration",
|
|
33
34
|
"test:emulator": "bash ./scripts/emulator-tests/run.sh",
|
|
34
35
|
"test:extensions-deploy": "bash ./scripts/extensions-deploy-tests/run.sh",
|
|
@@ -128,7 +129,8 @@
|
|
|
128
129
|
"google-auth-library": "^9.11.0",
|
|
129
130
|
"inquirer": "^8.2.6",
|
|
130
131
|
"inquirer-autocomplete-prompt": "^2.0.1",
|
|
131
|
-
"isolate-package": "^1.
|
|
132
|
+
"isolate-package": "^1.22.0",
|
|
133
|
+
"js-yaml": "^3.14.1",
|
|
132
134
|
"jsonwebtoken": "^9.0.0",
|
|
133
135
|
"leven": "^3.1.0",
|
|
134
136
|
"libsodium-wrappers": "^0.7.10",
|
|
@@ -152,7 +154,7 @@
|
|
|
152
154
|
"sql-formatter": "^15.3.0",
|
|
153
155
|
"stream-chain": "^2.2.4",
|
|
154
156
|
"stream-json": "^1.7.3",
|
|
155
|
-
"superstatic": "^9.0
|
|
157
|
+
"superstatic": "^9.1.0",
|
|
156
158
|
"tar": "^6.1.11",
|
|
157
159
|
"tcp-port-used": "^1.0.2",
|
|
158
160
|
"tmp": "^0.2.3",
|
|
@@ -224,6 +226,7 @@
|
|
|
224
226
|
"eslint": "^8.56.0",
|
|
225
227
|
"eslint-config-google": "^0.14.0",
|
|
226
228
|
"eslint-config-prettier": "^9.1.0",
|
|
229
|
+
"eslint-plugin-brikke": "^2.2.2",
|
|
227
230
|
"eslint-plugin-jsdoc": "^48.0.1",
|
|
228
231
|
"eslint-plugin-prettier": "^5.1.3",
|
|
229
232
|
"firebase": "^9.16.0",
|
|
@@ -239,6 +242,7 @@
|
|
|
239
242
|
"nyc": "^15.1.0",
|
|
240
243
|
"openapi-merge": "^1.0.23",
|
|
241
244
|
"openapi-typescript": "^4.5.0",
|
|
245
|
+
"openapi3-ts": "^3.2.0",
|
|
242
246
|
"prettier": "^3.2.4",
|
|
243
247
|
"proxy": "^1.0.2",
|
|
244
248
|
"puppeteer": "^19.0.0",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
specVersion: "v1beta"
|
|
2
|
-
serviceId: __serviceId__
|
|
3
|
-
location: __location__
|
|
4
|
-
schema:
|
|
5
|
-
source: "./schema"
|
|
6
|
-
datasource:
|
|
7
|
-
postgresql:
|
|
8
|
-
database: __cloudSqlDatabase__
|
|
9
|
-
cloudSql:
|
|
10
|
-
instanceId: __cloudSqlInstanceId__
|
|
11
|
-
# schemaValidation: "COMPATIBLE"
|
|
12
|
-
connectorDirs: __connectorDirs__
|