Skip to content

Commit

Permalink
fixing nits
Browse files Browse the repository at this point in the history
  • Loading branch information
Ingrid Fielker committed Aug 16, 2024
1 parent 1a45154 commit a56adbd
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 58 deletions.
3 changes: 1 addition & 2 deletions scripts/bin-test/sources/commonjs-grouped/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ const ttOnStart = extRef1.onStart((event) => {
exports.ttOnStart = ttOnStart;

// A Firebase extension by localPath
const extLocal2 = backfill("extLocal2", {
exports.extLocal2 = backfill("extLocal2", {
DO_BACKFILL: "False",
LOCATION: "us-central1",
});
exports.extLocal2 = extLocal2;

exports.g1 = require("./g1");
3 changes: 1 addition & 2 deletions scripts/bin-test/sources/commonjs-main/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ const ttOnStart = extRef1.onStart((event) => {
exports.ttOnStart = ttOnStart;

// A Firebase extension by localPath
const extLocal2 = backfill("extLocal2", {
exports.extLocal2 = backfill("extLocal2", {
DO_BACKFILL: "False",
LOCATION: "us-central1",
});
exports.extLocal2 = extLocal2;
5 changes: 2 additions & 3 deletions scripts/bin-test/sources/commonjs-preserve/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ const ttOnStart = extRef1.onStart((event) => {
exports.ttOnStart = ttOnStart;

// A Firebase extension by localPath
const extLocal2 = backfill("extLocal2", {
exports.extLocal2 = backfill("extLocal2", {
DO_BACKFILL: "False",
LOCATION: "us-central1",
});
exports.extLocal2 = extLocal2;
});
3 changes: 1 addition & 2 deletions scripts/bin-test/sources/commonjs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ const ttOnStart = extRef1.onStart((event) => {
exports.ttOnStart = ttOnStart;

// A Firebase extension by localPath
const extLocal2 = backfill("extLocal2", {
exports.extLocal2 = backfill("extLocal2", {
DO_BACKFILL: "False",
LOCATION: "us-central1",
});
exports.extLocal2 = extLocal2;
3 changes: 1 addition & 2 deletions spec/fixtures/sources/commonjs-grouped/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ const ttOnStart = extRef1.onStart((event) => {
exports.ttOnStart = ttOnStart;

// A Firebase extension by localPath
const extLocal2 = backfill("extLocal2", {
exports.extLocal2 = backfill("extLocal2", {
DO_BACKFILL: "False",
LOCATION: "us-central1",
});
exports.extLocal2 = extLocal2;

exports.g1 = require("./g1");
5 changes: 2 additions & 3 deletions spec/fixtures/sources/commonjs-main/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ const ttOnStart = extRef1.onStart((event) => {
exports.ttOnStart = ttOnStart;

// A Firebase extension by localPath
const extLocal2 = backfill("extLocal2", {
exports.extLocal2 = backfill("extLocal2", {
DO_BACKFILL: "False",
LOCATION: "us-central1",
});
exports.extLocal2 = extLocal2;
});
26 changes: 0 additions & 26 deletions spec/fixtures/sources/commonjs-parametrized-fields/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
const functions = require("../../../../src/v1/index");
const functionsv2 = require("../../../../src/v2/index");
const firestoreTranslateText = require("../../extsdk/translate").firestoreTranslateText;
const backfill = require("../../extsdk/local").backfill;
const params = require("../../../../src/params");
params.clearParams();

Expand Down Expand Up @@ -30,27 +28,3 @@ exports.v2http = functionsv2.https.onRequest({
}, (req, resp) => {
resp.status(200).send("Hello world!");
});

// A Firebase extension by ref
const extRef1 = firestoreTranslateText("extRef1", {
"COLLECTION_PATH": "collection1",
"INPUT_FIELD_NAME": "input1",
"LANGUAGES": "de,es",
"OUTPUT_FIELD_NAME": "translated",
"_EVENT_ARC_REGION": "us-central1",
"_FUNCTION_LOCATION": "us-central1",
});
exports.extRef1 = extRef1;

// A Firebase function defined by extension event
const ttOnStart = extRef1.onStart((event) => {
console.log("onStart got event: " + JSON.stringify(event, null, 2));
});
exports.ttOnStart = ttOnStart;

// A Firebase extension by localPath
const extLocal2 = backfill("extLocal2", {
DO_BACKFILL: "False",
LOCATION: "us-central1",
});
exports.extLocal2 = extLocal2;
3 changes: 1 addition & 2 deletions spec/fixtures/sources/commonjs-params/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ const ttOnStart = extRef1.onStart((event) => {
exports.ttOnStart = ttOnStart;

// A Firebase extension by localPath
const extLocal2 = backfill("extLocal2", {
exports.extLocal2 = backfill("extLocal2", {
DO_BACKFILL: "False",
LOCATION: "us-central1",
});
exports.extLocal2 = extLocal2;
5 changes: 2 additions & 3 deletions spec/fixtures/sources/commonjs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ const ttOnStart = extRef1.onStart((event) => {
exports.ttOnStart = ttOnStart;

// A Firebase extension by localPath
const extLocal2 = backfill("extLocal2", {
exports.extLocal2 = backfill("extLocal2", {
DO_BACKFILL: "False",
LOCATION: "us-central1",
});
exports.extLocal2 = extLocal2;
});
15 changes: 2 additions & 13 deletions spec/runtime/loader.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,8 @@ describe("loadStack", () => {
{ name: "INT_PARAM", type: "int" },
{ name: "BOOLEAN_PARAM", type: "boolean" },
],
requiredAPIs: [],
extensions: {},
endpoints: {
v1http: {
...MINIMAL_V1_ENDPOINT,
Expand All @@ -463,19 +465,6 @@ describe("loadStack", () => {
labels: {},
httpsTrigger: {},
},
ttOnStart: {
...MINIMAL_V2_ENDPOINT,
entryPoint: "ttOnStart",
eventTrigger: {
channel: "projects/locations/us-central1/channels/firebase",
eventFilters: {},
eventType: "firebase.extensions.firestore-translate-text.v1.onStart",
retry: false,
},
labels: {},
platform: "gcfv2",
region: ["us-central1"],
},
},
},
},
Expand Down

0 comments on commit a56adbd

Please sign in to comment.