Skip to content

Commit

Permalink
refactor: improve variable logic (#17086)
Browse files Browse the repository at this point in the history
* Improve app processing with async/await and dynamic imports, also fix eslint errors.

* refactor

* added back a comment
  • Loading branch information
retrogtx authored Oct 15, 2024
1 parent be1c6eb commit 2acb555
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions packages/app-store-cli/src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,18 @@ import type { AppMeta } from "@calcom/types/App";
import { APP_STORE_PATH } from "./constants";
import { getAppName } from "./utils/getAppName";

let isInWatchMode = false;
if (process.argv[2] === "--watch") {
isInWatchMode = true;
}
const isInWatchMode = process.argv[2] === "--watch";

const formatOutput = (source: string) =>
prettier.format(source, {
parser: "babel",
...prettierConfig,
});

const getVariableName = function (appName: string) {
return appName.replace(/[-.]/g, "_");
};
const getVariableName = (appName: string) => appName.replace(/[-.]/g, "_");

const getAppId = function (app: { name: string }) {
// Handle stripe separately as it's an old app with different dirName than slug/appId
return app.name === "stripepayment" ? "stripe" : app.name;
};
// INFO: Handle stripe separately as it's an old app with different dirName than slug/appId
const getAppId = (app: { name: string }) => (app.name === "stripepayment" ? "stripe" : app.name);

type App = Partial<AppMeta> & {
name: string;
Expand Down

0 comments on commit 2acb555

Please sign in to comment.