Skip to content

Commit

Permalink
move constants together
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskalmar committed Nov 18, 2023
1 parent 5f238f8 commit e29cf77
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 0 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,6 @@ export type GenerateOnlyModeConfig = z.infer<
export type Config = z.infer<typeof ConfigSchema>;
export type CustomProjectConfig = z.infer<typeof FlexibleConfigSchema>;

export const MEDIA_UPLOAD_CONCURRENCY = 10;

export let config: Config;

export const isPlatformModeConfig = (
Expand Down
5 changes: 5 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
export const notSupported = 'not supported';

export const MEDIA_UPLOAD_CONCURRENCY = 10;

export const POST_HOG_API_KEY =
'phc_RDNnzvANh1mNm9JKogF9UunG3Ky02YCxWP9gXScKShk';
3 changes: 2 additions & 1 deletion src/upload.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { mapLimit } from 'async';
import { MEDIA_UPLOAD_CONCURRENCY, type PlatformModeConfig } from './config';
import { type PlatformModeConfig } from './config';
import type { ExtendedShotItem } from './types';
import { uploadShot } from './api';
import { log } from './log';
import { parseHrtimeToSeconds } from './utils';
import { MEDIA_UPLOAD_CONCURRENCY } from './constants';

export const uploadRequiredShots = async ({
config,
Expand Down
4 changes: 1 addition & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { hideBin } from 'yargs/helpers';
import { config, isPlatformModeConfig } from './config';
import { log } from './log';
import type { ShotItem } from './types';
import { notSupported } from './constants';
import { POST_HOG_API_KEY, notSupported } from './constants';

export type ParsedYargs = {
_: ['update', 'meta', 'docker', 'local'];
Expand Down Expand Up @@ -47,8 +47,6 @@ export type Changes = {
addition: FilenameWithAllPaths[];
};

const POST_HOG_API_KEY = 'phc_RDNnzvANh1mNm9JKogF9UunG3Ky02YCxWP9gXScKShk';

export const isUpdateMode = (): boolean => {
// @ts-expect-error TBD
const args = yargs(hideBin(process.argv)).parse() as ParsedYargs;
Expand Down

0 comments on commit e29cf77

Please sign in to comment.