diff --git a/src/fs.ts b/src/fs.ts index 1ad1ad2..dfd5537 100644 --- a/src/fs.ts +++ b/src/fs.ts @@ -10,6 +10,7 @@ import { join, sep } from 'path' import { readFile, writeFile } from './util/fs' import { getFileFieldPaths } from './util/get-file-fields' import { buildLocalePath, filter, getPathKeys, removeUnwantedKeys } from './util/index' +import { LOG_MESSAGES } from './util/messages' import { validateContentTypeDeletedObject, validateEntryAssetDeletedObject, @@ -65,7 +66,7 @@ export class FilesystemStore { public publish(input) { return new Promise(async (resolve, reject) => { try { - debug(`Publishing ${JSON.stringify(input)}`) + debug(LOG_MESSAGES.PUBLISHING_ENTRY(input)) validatePublishedObject(input) if (existsSync(this.localePath)) { // if its a new locale, keep track! diff --git a/src/util/messages.ts b/src/util/messages.ts new file mode 100644 index 0000000..fb71e1b --- /dev/null +++ b/src/util/messages.ts @@ -0,0 +1,24 @@ +/*! + * DataSync Content Store Filesystem - Messages + * Copyright (c) Contentstack LLC + * MIT Licensed + */ + +/** + * Centralized message store for all log messages, error messages, and user-facing strings. + * This provides a single source of truth for all messages in the application, + * making it easier to maintain consistency and support future localization. + */ + +export const LOG_MESSAGES = { + PUBLISHING_ENTRY: (input: any) => `Publishing entry: ${JSON.stringify(input)}`, +} as const; + +export const ERROR_MESSAGES = { + // Add error messages here as needed +} as const; + +export const INFO_MESSAGES = { + // Add info messages here as needed +} as const; +