Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/datasync-content-store-filesystem",
"version": "2.1.6",
"version": "2.1.7",
"description": "Datasync content store library - saves data in filesystem",
"main": "./dist",
"types": "./typings",
Expand Down
3 changes: 2 additions & 1 deletion src/fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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!
Expand Down
24 changes: 24 additions & 0 deletions src/util/messages.ts
Original file line number Diff line number Diff line change
@@ -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;

10 changes: 10 additions & 0 deletions typings/util/messages.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*!
* DataSync Content Store Filesystem - Messages
* Copyright (c) Contentstack LLC
* MIT Licensed
*/
export declare const LOG_MESSAGES: {
readonly PUBLISHING_ENTRY: (input: any) => string;
};
export declare const ERROR_MESSAGES: {};
export declare const INFO_MESSAGES: {};
Loading