From aee7af835de4232763ab471c2b3c083a12890246 Mon Sep 17 00:00:00 2001 From: "harshitha.d" Date: Thu, 12 Jun 2025 10:32:01 +0530 Subject: [PATCH 1/3] Refactor: Update mkdirp import to use named import for consistency --- src/fs.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fs.ts b/src/fs.ts index 584fbee..4d4f4d6 100644 --- a/src/fs.ts +++ b/src/fs.ts @@ -7,7 +7,7 @@ import { debug as Debug } from 'debug' import { existsSync, unlinkSync } from 'fs' import { cloneDeep, compact } from 'lodash' -import mkdirp from 'mkdirp' +import { sync as mkdirpSync } from 'mkdirp' import { join, sep } from 'path' import { readFile, writeFile } from './util/fs' import { getFileFieldPaths } from './util/get-file-fields' @@ -167,7 +167,7 @@ export class FilesystemStore { contentTypePathKeys.splice(contentTypePathKeys.length - 1) const contentTypeFolderPath = join.apply(contentTypePathKeys) - mkdirp.sync(contentTypeFolderPath) + mkdirpSync(contentTypeFolderPath) await writeFile(contentTypePath, JSON.stringify([schema])) } @@ -218,7 +218,7 @@ export class FilesystemStore { } } else { // create folder, if it does not exist! - mkdirp.sync(assetFolderPath) + mkdirpSync(assetFolderPath) await writeFile(assetPath, JSON.stringify([data])) } @@ -501,7 +501,7 @@ export class FilesystemStore { } } else { // entry folder does not exist! - mkdirp.sync(entryFolderPath) + mkdirpSync(entryFolderPath) await writeFile(entryPath, JSON.stringify([entry])) } From 7f6ce0625c3157630d2357cb7b2fd1df789e096c Mon Sep 17 00:00:00 2001 From: "harshitha.d" Date: Thu, 12 Jun 2025 10:32:19 +0530 Subject: [PATCH 2/3] Version bump: Update package version to 2.1.4 in package.json and package-lock.json --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8f819b0..bc9883e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@contentstack/datasync-content-store-filesystem", - "version": "2.1.3", + "version": "2.1.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@contentstack/datasync-content-store-filesystem", - "version": "2.1.3", + "version": "2.1.4", "license": "MIT", "dependencies": { "debug": "^4.4.1", diff --git a/package.json b/package.json index 831099f..0af134d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@contentstack/datasync-content-store-filesystem", - "version": "2.1.3", + "version": "2.1.4", "description": "Datasync content store library - saves data in filesystem", "main": "./dist", "types": "./typings", From 2a5cc3382273da85572d2ef43a4d5308c77624d2 Mon Sep 17 00:00:00 2001 From: "harshitha.d" Date: Thu, 12 Jun 2025 11:57:30 +0530 Subject: [PATCH 3/3] Refactor: Replace mkdirpSync with mkdirSync --- src/fs.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/fs.ts b/src/fs.ts index 4d4f4d6..1feed12 100644 --- a/src/fs.ts +++ b/src/fs.ts @@ -5,9 +5,8 @@ */ import { debug as Debug } from 'debug' -import { existsSync, unlinkSync } from 'fs' +import { existsSync, unlinkSync, mkdirSync } from 'fs' import { cloneDeep, compact } from 'lodash' -import { sync as mkdirpSync } from 'mkdirp' import { join, sep } from 'path' import { readFile, writeFile } from './util/fs' import { getFileFieldPaths } from './util/get-file-fields' @@ -167,7 +166,7 @@ export class FilesystemStore { contentTypePathKeys.splice(contentTypePathKeys.length - 1) const contentTypeFolderPath = join.apply(contentTypePathKeys) - mkdirpSync(contentTypeFolderPath) + mkdirSync(contentTypeFolderPath) await writeFile(contentTypePath, JSON.stringify([schema])) } @@ -218,7 +217,7 @@ export class FilesystemStore { } } else { // create folder, if it does not exist! - mkdirpSync(assetFolderPath) + mkdirSync(assetFolderPath) await writeFile(assetPath, JSON.stringify([data])) } @@ -501,7 +500,7 @@ export class FilesystemStore { } } else { // entry folder does not exist! - mkdirpSync(entryFolderPath) + mkdirSync(entryFolderPath) await writeFile(entryPath, JSON.stringify([entry])) }