🎥 Make videos programmatically with React
running prettier
Matt McGillivray8a504e0565a2
diff --git a/packages/gcp/src/admin/bundle-renderLogic.ts b/packages/gcp/src/admin/bundle-renderLogic.tsindex a28aef52df..f430dff10d 100644--- a/packages/gcp/src/admin/bundle-renderLogic.ts+++ b/packages/gcp/src/admin/bundle-renderLogic.ts@@ -12,9 +12,7 @@ const bundleRenderLogic = async () => {(fs.rmSync ?? fs.rmdirSync)(outdir, {recursive: true});fs.mkdirSync(outdir, {recursive: true});- const template = require.resolve(- path.join(__dirname, '../functions/index')- );+ const template = require.resolve(path.join(__dirname, '../functions/index'));await BundlerInternals.esbuild.build({platform: 'node',@@ -33,4 +31,4 @@ const bundleRenderLogic = async () => {console.log('distribution bundled.');};-bundleRenderLogic()+bundleRenderLogic();diff --git a/packages/gcp/src/api/create-bucket.ts b/packages/gcp/src/api/create-bucket.tsindex 80b2a62fa6..140384be1e 100644--- a/packages/gcp/src/api/create-bucket.ts+++ b/packages/gcp/src/api/create-bucket.ts@@ -8,10 +8,10 @@ export const createBucket = async ({region: GcpRegion;bucketName: string;}) => {- const cloudStorageClient = getCloudStorageClient()+ const cloudStorageClient = getCloudStorageClient();// metadata: https://googleapis.dev/nodejs/storage/latest/global.html#CreateBucketRequestawait cloudStorageClient.createBucket(bucketName, {- location: region+ location: region,});};diff --git a/packages/gcp/src/api/deploy-site.ts b/packages/gcp/src/api/deploy-site.tsindex 22943e1e89..9927bedc84 100644--- a/packages/gcp/src/api/deploy-site.ts+++ b/packages/gcp/src/api/deploy-site.ts@@ -1,15 +1,15 @@-import type { WebpackOverrideFn } from '@remotion/bundler';-import { gcpLs, gcpDeleteFile } from '../functions/helpers/io';-import { bundleSite } from '../shared/bundle-site';-import { getSitesKey } from '../shared/constants';-import { getStorageDiffOperations } from '../shared/get-storage-operations';-import { makeStorageServeUrl } from '../shared/make-storage-url';-import { randomHash } from '../shared/random-hash';-import { validateBucketName } from '../shared/validate-bucketname';-import { validateSiteName } from '../shared/validate-site-name';-import type { UploadDirProgress } from './upload-dir';-import { uploadDir } from './upload-dir';-import { getCloudStorageClient } from './helpers/get-cloud-storage-client';+import type {WebpackOverrideFn} from '@remotion/bundler';+import {gcpDeleteFile, gcpLs} from '../functions/helpers/io';+import {bundleSite} from '../shared/bundle-site';+import {getSitesKey} from '../shared/constants';+import {getStorageDiffOperations} from '../shared/get-storage-operations';+import {makeStorageServeUrl} from '../shared/make-storage-url';+import {randomHash} from '../shared/random-hash';+import {validateBucketName} from '../shared/validate-bucketname';+import {validateSiteName} from '../shared/validate-site-name';+import {getCloudStorageClient} from './helpers/get-cloud-storage-client';+import type {UploadDirProgress} from './upload-dir';+import {uploadDir} from './upload-dir';export type DeploySiteInput = {entryPoint: string;@@ -49,23 +49,23 @@ export const deploySite = async ({siteName,options,}: DeploySiteInput): DeploySiteOutput => {- validateBucketName(bucketName, { mustStartWithRemotion: true });+ validateBucketName(bucketName, {mustStartWithRemotion: true});const siteId = siteName ?? randomHash();validateSiteName(siteId);- const cloudStorageClient = getCloudStorageClient()+ const cloudStorageClient = getCloudStorageClient();// check if bucket exists- await cloudStorageClient.bucket(bucketName).get()+ await cloudStorageClient.bucket(bucketName).get();const subFolder = getSitesKey(siteId);-+// gcpLs is a function that lists all files in a bucketconst [files, bundled] = await Promise.all([gcpLs({bucketName,- prefix: subFolder+ prefix: subFolder,}),bundleSite(entryPoint, options?.onBundleProgress ?? (() => undefined), {publicPath: `/${bucketName}/${subFolder}/`,@@ -76,7 +76,7 @@ export const deploySite = async ({}),]);- const { toDelete, toUpload, existingCount } = await getStorageDiffOperations({+ const {toDelete, toUpload, existingCount} = await getStorageDiffOperations({objects: files,bundle: bundled,prefix: subFolder,@@ -101,7 +101,7 @@ export const deploySite = async ({]);return {- serveUrl: makeStorageServeUrl({ bucketName, subFolder }),+ serveUrl: makeStorageServeUrl({bucketName, subFolder}),siteName: siteId,stats: {uploadedFiles: toUpload.length,diff --git a/packages/gcp/src/api/helpers/get-cloud-run-client.ts b/packages/gcp/src/api/helpers/get-cloud-run-client.tsindex 0c9bdba4e5..a4ea32fc9b 100644--- a/packages/gcp/src/api/helpers/get-cloud-run-client.ts+++ b/packages/gcp/src/api/helpers/get-cloud-run-client.ts@@ -1,13 +1,13 @@-import { v2 } from '@google-cloud/run';+import {v2} from '@google-cloud/run';import fs from 'fs';-const { ServicesClient } = v2;+const {ServicesClient} = v2;const sa_data = fs.readFileSync('./sa-key.json', 'utf8');-const sa_json = JSON.parse(sa_data)+const sa_json = JSON.parse(sa_data);export const getCloudRunClient = () => {return new ServicesClient({- credentials: sa_json- })+ credentials: sa_json,+ });};diff --git a/packages/gcp/src/api/helpers/get-cloud-storage-client.ts b/packages/gcp/src/api/helpers/get-cloud-storage-client.tsindex ad456669b5..aa5dfe13a6 100644--- a/packages/gcp/src/api/helpers/get-cloud-storage-client.ts+++ b/packages/gcp/src/api/helpers/get-cloud-storage-client.ts@@ -1,11 +1,11 @@-import { Storage } from '@google-cloud/storage';+import {Storage} from '@google-cloud/storage';import fs from 'fs';const sa_data = fs.readFileSync('./sa-key.json', 'utf8');-const sa_json = JSON.parse(sa_data)+const sa_json = JSON.parse(sa_data);export const getCloudStorageClient = () => {return new Storage({- credentials: sa_json- })-};\ No newline at end of file+ credentials: sa_json,+ });+};diff --git a/packages/gcp/src/cli/args.ts b/packages/gcp/src/cli/args.tsindex 543a460316..b473d223ad 100644--- a/packages/gcp/src/cli/args.ts+++ b/packages/gcp/src/cli/args.ts@@ -23,7 +23,4 @@ export const parsedGcpCli = CliInternals.minimist<GCPCommandLineOptions>();export const forceFlagProvided =- parsedGcpCli.f ||- parsedGcpCli.force ||- parsedGcpCli.yes ||- parsedGcpCli.y;+ parsedGcpCli.f || parsedGcpCli.force || parsedGcpCli.yes || parsedGcpCli.y;diff --git a/packages/gcp/src/cli/help.ts b/packages/gcp/src/cli/help.tsindex d8316bcce5..dbcda9b03e 100644--- a/packages/gcp/src/cli/help.ts+++ b/packages/gcp/src/cli/help.ts@@ -24,10 +24,11 @@ export const printHelp = () => {Log.info();Log.info(`${BINARY_NAME} ${CLOUD_RUN_COMMAND}`);- Log.info(CliInternals.chalk.gray('Deploy and manage GCP Cloud Run services.'));+ Log.info(+ CliInternals.chalk.gray('Deploy and manage GCP Cloud Run services.')+ );Log.info();Log.info(`${BINARY_NAME} ${SITES_COMMAND}`);Log.info(CliInternals.chalk.gray('Deploy and manage Remotion projects.'));-};diff --git a/packages/gcp/src/index.ts b/packages/gcp/src/index.tsindex c3fa5c9c42..71976303aa 100644--- a/packages/gcp/src/index.ts+++ b/packages/gcp/src/index.ts@@ -1,3 +1,3 @@import {GCPInternals} from './internals';-export { GCPInternals }\ No newline at end of file+export {GCPInternals};diff --git a/packages/gcp/src/pricing/gcp-regions.ts b/packages/gcp/src/pricing/gcp-regions.tsindex 23112bca3b..b18e499b73 100644--- a/packages/gcp/src/pricing/gcp-regions.ts+++ b/packages/gcp/src/pricing/gcp-regions.ts@@ -33,7 +33,7 @@ export const GCP_REGIONS = ['us-west1','us-west2','us-west3',- 'us-west4'+ 'us-west4',] as const;-export type GcpRegion = typeof GCP_REGIONS[number];+export type GcpRegion = (typeof GCP_REGIONS)[number];diff --git a/packages/gcp/src/shared/constants.ts b/packages/gcp/src/shared/constants.tsindex 5dcf18fcba..bd52ff893a 100644--- a/packages/gcp/src/shared/constants.ts+++ b/packages/gcp/src/shared/constants.ts@@ -5,4 +5,4 @@ export const BINARY_NAME = 'remotion gcp';export const REMOTION_BUCKET_PREFIX = 'remotioncloudrun-';-export const getSitesKey = (siteId: string) => `sites/${siteId}`;\ No newline at end of file+export const getSitesKey = (siteId: string) => `sites/${siteId}`;diff --git a/packages/gcp/src/shared/validate-service-name.ts b/packages/gcp/src/shared/validate-service-name.tsindex e111c92600..4fb68148f6 100644--- a/packages/gcp/src/shared/validate-service-name.ts+++ b/packages/gcp/src/shared/validate-service-name.ts@@ -17,7 +17,7 @@ export const validateServiceName = (serviceName: unknown) => {if (!serviceName.match(/^[a-zA-Z][a-zA-Z0-9-]{0,48}[a-zA-Z0-9]$/g)) {throw new Error(- "The `serviceName` must match the RegExp `/^[a-zA-Z][a-zA-Z0-9-]{0,48}[a-zA-Z0-9]$/g`. This means it may only start with a letter, end with a letter or number, and contain up to 49 lowercase letters, numbers or hyphens. You passed: " ++ 'The `serviceName` must match the RegExp `/^[a-zA-Z][a-zA-Z0-9-]{0,48}[a-zA-Z0-9]$/g`. This means it may only start with a letter, end with a letter or number, and contain up to 49 lowercase letters, numbers or hyphens. You passed: ' +serviceName +'. Check for invalid characters.');