Skip to content

Commit 74d96f7

Browse files
authored
Removing support for .bolt rules (#9339)
* Removing support for .bolt rules * Changelog
1 parent 2ef8874 commit 74d96f7

File tree

5 files changed

+11
-47
lines changed

5 files changed

+11
-47
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
- [firestore] Changed `firestore:backups:list --json` to return a `listBackupsResponse` object instead of a raw array of backups. This is a breaking change that provides more information, including unreachable locations.
1+
- [BREAKING] Changed `firestore:backups:list --json` to return a `listBackupsResponse` object instead of a raw array of backups.
2+
- [BREAKING] Removed support for '.bolt' rules files.
3+
- [BREAKING] Removed support for running emulators with Java versions prior to 21.
24
- Add a confirmation in `firebase init dataconnect` before asking for app idea description. (#9282)
3-
- [BREAKING] Removes support for running emulators with Java versions prior to 21.

src/config.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import * as utils from "./utils";
1616
import { getValidator, getErrorMessage } from "./firebaseConfigValidate";
1717
import { logger } from "./logger";
1818
import { loadCJSON } from "./loadCJSON";
19-
const parseBoltRules = require("./parseBoltRules");
2019

2120
export class Config {
2221
static DEFAULT_FUNCTIONS_SOURCE = "functions";
@@ -68,7 +67,7 @@ export class Config {
6867
}
6968

7069
// If a top-level key contains a string path pointing to a suported file
71-
// type (JSON or Bolt), we read the file.
70+
// type (JSON ), we read the file.
7271
//
7372
// TODO: This is janky and confusing behavior, we should remove it ASAP.
7473
Config.MATERIALIZE_TARGETS.forEach((target) => {
@@ -166,10 +165,9 @@ export class Config {
166165
return loadCJSON(fullPath);
167166
/* istanbul ignore-next */
168167
case ".bolt":
169-
if (target === "database") {
170-
this.notes.databaseRules = "bolt";
171-
}
172-
return parseBoltRules(fullPath);
168+
throw new FirebaseError(
169+
"As of firebase-tools@15.0.0, .bolt rules are no longer supported.",
170+
);
173171
default:
174172
throw new FirebaseError(
175173
"Parse Error: " + filePath + " is not of a supported config file type",

src/deploy/database/prepare.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import * as clc from "colorette";
22
import * as path from "path";
33

44
import { FirebaseError } from "../../error";
5-
import { parseBoltRules } from "../../parseBoltRules";
65
import * as rtdb from "../../rtdb";
76
import * as utils from "../../utils";
87
import * as dbRulesConfig from "../../database/rulesConfig";
@@ -34,8 +33,9 @@ export function prepare(context: any, options: DeployOptions): Promise<any> {
3433
ruleFiles[file] = options.config.readProjectFile(file);
3534
break;
3635
case ".bolt":
37-
ruleFiles[file] = parseBoltRules(file);
38-
break;
36+
throw new FirebaseError(
37+
"As of firebase-tools@15.0.0, .bolt rules are no longer supported.",
38+
);
3939
default:
4040
throw new FirebaseError("Unexpected rules format " + path.extname(file));
4141
}

src/emulator/databaseEmulator.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { Constants } from "./constants";
1010
import { EmulatorRegistry } from "./registry";
1111
import { EmulatorLogger } from "./emulatorLogger";
1212
import { FirebaseError } from "../error";
13-
import { parseBoltRules } from "../parseBoltRules";
1413
import { connectableHostname } from "../utils";
1514

1615
export interface DatabaseEmulatorArgs {
@@ -163,11 +162,7 @@ export class DatabaseEmulator implements EmulatorInstance {
163162
}
164163

165164
private async updateRules(instance: string, rulesPath: string): Promise<any> {
166-
const rulesExt = path.extname(rulesPath);
167-
const content =
168-
rulesExt === ".bolt"
169-
? parseBoltRules(rulesPath).toString()
170-
: fs.readFileSync(rulesPath, "utf8");
165+
const content = fs.readFileSync(rulesPath, "utf8");
171166

172167
try {
173168
await EmulatorRegistry.client(Emulators.DATABASE).put(`/.settings/rules.json`, content, {

src/parseBoltRules.ts

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)