Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions src/ensureCloudResourceLocation.ts

This file was deleted.

14 changes: 0 additions & 14 deletions src/init/features/storage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { expect } from "chai";
import * as _ from "lodash";
import * as sinon from "sinon";

import { FirebaseError } from "../../error";
import { Config } from "../../config";
import { doSetup } from "./storage";
import * as prompt from "../../prompt";
Expand Down Expand Up @@ -36,18 +35,5 @@ describe("storage", () => {

expect(_.get(setup, "config.storage.rules")).to.deep.equal("storage.rules");
});

it("should error when cloud resource location is not set", async () => {
const setup = {
config: {},
rcfile: {},
projectId: "my-project-123",
};

await expect(doSetup(setup, new Config("/path/to/src", {}))).to.eventually.be.rejectedWith(
FirebaseError,
"Cloud resource location is not set",
);
});
});
});
2 changes: 0 additions & 2 deletions src/init/features/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

import { logger } from "../../logger";
import { promptOnce } from "../../prompt";
import { ensureLocationSet } from "../../ensureCloudResourceLocation";
import { readTemplateSync } from "../../templates";

const RULES_TEMPLATE = readTemplateSync("init/storage/storage.rules");

export async function doSetup(setup: any, config: any): Promise<void> {

Check warning on line 9 in src/init/features/storage.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing JSDoc comment

Check warning on line 9 in src/init/features/storage.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type

Check warning on line 9 in src/init/features/storage.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
setup.config.storage = {};

Check warning on line 10 in src/init/features/storage.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .config on an `any` value
ensureLocationSet(setup.projectLocation, "Cloud Storage");

logger.info();
logger.info("Firebase Storage Security Rules allow you to define how and when to allow");
Expand All @@ -23,6 +21,6 @@
message: "What file should be used for Storage Rules?",
default: "storage.rules",
});
setup.config.storage.rules = storageRulesFile;

Check warning on line 24 in src/init/features/storage.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .config on an `any` value
await config.askWriteProjectFile(setup.config.storage.rules, RULES_TEMPLATE);

Check warning on line 25 in src/init/features/storage.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .askWriteProjectFile on an `any` value

Check warning on line 25 in src/init/features/storage.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe call of an `any` typed value

Check warning on line 25 in src/init/features/storage.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .config on an `any` value
}
Loading