convert config file from json to ts

This commit is contained in:
Shams mosowi
2020-07-14 12:32:57 +10:00
parent 852120a9de
commit f50ce2c2d2
3 changed files with 6 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
const fs = require("fs");
const main = configString => {
fs.writeFileSync("./src/functionConfig.json", configString);
fs.writeFileSync("./src/functionConfig.ts", `export default ${configString}`);
};
main(process.argv[2]);

View File

@@ -5,7 +5,7 @@ export const callable = callableFns;
// all the cloud functions bellow are deployed using the triggerCloudBuild callable function
// these functions are designed to be built and deployed based on the configuration passed through the callable
import * as config from "./functionConfig.json"; // generated using generateConfig.ts
import config from "./functionConfig"; // generated using generateConfig.ts
import algoliaFnsGenerator from "./algolia"; // algolia sync functions template
import collectionSyncFnsGenerator from "./collectionSync";
import snapshotSyncFnsGenerator from "./snapshotSync";
@@ -18,6 +18,10 @@ export const FT_algolia = {
[functionConfig.name]: { ...algoliaFnsGenerator(functionConfig) },
};
// {
// [functionConfig.name]: { ...algoliaFnsGenerator(functionConfig) },
// };
export const FT_sync = {
[`${`${`${functionConfig.source}`
.replace(/\//g, "_")

View File

@@ -260,7 +260,6 @@ const Filters = ({ columns, setFilters }: any) => {
/\{\{(.*?)\}\}/g,
(m, k) => userClaims[k]
)}
// filters={'regions:SYD AND roles:COACHING"}
onChange={value => {
setQuery(query => ({ ...query, value }));
}}