6 Commits

Author SHA1 Message Date
c73a931dad v1.1.3
Some checks failed
Default (tags) / security (push) Successful in 41s
Default (tags) / test (push) Failing after 38s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-11-30 18:10:25 +00:00
3bdb014d25 fix(smartfs.provider.node): Default createDirectory to recursive=true when option not provided in Node provider 2025-11-30 18:10:25 +00:00
5577e4e4de v1.1.2
Some checks failed
Default (tags) / security (push) Successful in 40s
Default (tags) / test (push) Failing after 36s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-11-29 21:01:51 +00:00
6308e198c7 fix(SmartFsProviderNode): Fix Node provider watch path handling and remove main test entry 2025-11-29 21:01:51 +00:00
381680f2e7 v1.1.1
Some checks failed
Default (tags) / security (push) Successful in 40s
Default (tags) / test (push) Failing after 38s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-11-29 20:26:02 +00:00
c9e45a9abe fix(smartfs.provider.node): Default deleteDirectory to recursive=true in Node provider 2025-11-29 20:26:02 +00:00
5 changed files with 31 additions and 12 deletions

View File

@@ -1,5 +1,26 @@
# Changelog
## 2025-11-30 - 1.1.3 - fix(smartfs.provider.node)
Default createDirectory to recursive=true when option not provided in Node provider
- Node provider: createDirectory now defaults to recursive=true when options.recursive is undefined.
- Prevents errors when creating nested directories without explicitly passing the recursive option.
- No API signature changes; behavior change is limited to the Node provider implementation.
## 2025-11-29 - 1.1.2 - fix(SmartFsProviderNode)
Fix Node provider watch path handling and remove main test entry
- Node provider: detect at start whether the watched path is a file or directory (fs.stat) and build fullPath accordingly so watching a single file does not incorrectly join the filename onto the file path.
- Watch callback: ensure events are evaluated against the configured filter using the correct full path.
- Tests: removed test/test.ts (main test entry that previously imported provider test files).
## 2025-11-29 - 1.1.1 - fix(smartfs.provider.node)
Default deleteDirectory to recursive=true in Node provider
- Changed SmartFsProviderNode.deleteDirectory to use recursive: options?.recursive ?? true when calling fs.rm.
- Directories will now be removed recursively by default when no recursive option is provided (was previously undefined).
- Retains force: true behavior to ignore missing targets and suppress errors.
## 2025-11-21 - 1.1.0 - feat(core)
Add SmartFS core library with providers, builders, interfaces, docs, tests and CI

View File

@@ -1,6 +1,6 @@
{
"name": "@push.rocks/smartfs",
"version": "1.1.0",
"version": "1.1.3",
"private": false,
"description": "a cross platform extendable fs module",
"main": "dist_ts/index.js",

View File

@@ -1,7 +0,0 @@
/**
* Main test entry point
* Imports all test files
*/
import './test.memory.provider.js';
import './test.node.provider.js';

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartfs',
version: '1.1.0',
version: '1.1.3',
description: 'a cross platform extendable fs module'
}

View File

@@ -237,14 +237,14 @@ export class SmartFsProviderNode implements ISmartFsProvider {
public async createDirectory(path: string, options?: { recursive?: boolean; mode?: number }): Promise<void> {
await fs.mkdir(path, {
recursive: options?.recursive,
recursive: options?.recursive ?? true,
mode: options?.mode,
});
}
public async deleteDirectory(path: string, options?: { recursive?: boolean }): Promise<void> {
await fs.rm(path, {
recursive: options?.recursive,
recursive: options?.recursive ?? true,
force: true,
});
}
@@ -266,6 +266,10 @@ export class SmartFsProviderNode implements ISmartFsProvider {
// --- Watch Operations ---
public async watch(path: string, callback: TWatchCallback, options?: IWatchOptions): Promise<IWatcherHandle> {
// Check once at start if we're watching a file or directory
const watchedStats = await fs.stat(path);
const isWatchingFile = watchedStats.isFile();
const watcher = fsSync.watch(
path,
{
@@ -274,7 +278,8 @@ export class SmartFsProviderNode implements ISmartFsProvider {
async (eventType, filename) => {
if (!filename) return;
const fullPath = pathModule.join(path, filename);
// For file watching, path IS the file; for directory, join with filename
const fullPath = isWatchingFile ? path : pathModule.join(path, filename);
// Apply filter
if (options?.filter && !this.matchesPathFilter(fullPath, options.filter)) {