@simplysm/core-node 13.0.75 → 13.0.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +353 -44
- package/dist/features/fs-watcher.d.ts.map +1 -1
- package/dist/features/fs-watcher.js +2 -2
- package/dist/features/fs-watcher.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/utils/fs.d.ts +30 -30
- package/dist/utils/fs.d.ts.map +1 -1
- package/dist/utils/fs.js +101 -99
- package/dist/utils/fs.js.map +1 -1
- package/dist/utils/path.d.ts +19 -19
- package/dist/utils/path.d.ts.map +1 -1
- package/dist/utils/path.js +17 -17
- package/dist/utils/path.js.map +1 -1
- package/dist/worker/create-worker.d.ts +1 -1
- package/dist/worker/create-worker.d.ts.map +1 -1
- package/dist/worker/create-worker.js +8 -8
- package/dist/worker/create-worker.js.map +1 -1
- package/dist/worker/types.d.ts +2 -2
- package/dist/worker/types.d.ts.map +1 -1
- package/dist/worker/worker.js +4 -4
- package/dist/worker/worker.js.map +1 -1
- package/package.json +2 -2
- package/src/features/fs-watcher.ts +2 -2
- package/src/index.ts +2 -2
- package/src/utils/fs.ts +570 -562
- package/src/utils/path.ts +24 -24
- package/src/worker/create-worker.ts +9 -9
- package/src/worker/types.ts +6 -6
- package/src/worker/worker.ts +4 -4
- package/tests/utils/fs-watcher.spec.ts +0 -53
- package/tests/utils/fs.spec.ts +123 -173
- package/tests/utils/path.spec.ts +55 -68
- package/tests/worker/sd-worker.spec.ts +0 -15
package/dist/utils/fs.d.ts
CHANGED
|
@@ -5,34 +5,34 @@ import "@simplysm/core-common";
|
|
|
5
5
|
* Checks if a file or directory exists (synchronous).
|
|
6
6
|
* @param targetPath - Path to check
|
|
7
7
|
*/
|
|
8
|
-
export declare function
|
|
8
|
+
export declare function existsSync(targetPath: string): boolean;
|
|
9
9
|
/**
|
|
10
10
|
* Checks if a file or directory exists (asynchronous).
|
|
11
11
|
* @param targetPath - Path to check
|
|
12
12
|
*/
|
|
13
|
-
export declare function
|
|
13
|
+
export declare function exists(targetPath: string): Promise<boolean>;
|
|
14
14
|
/**
|
|
15
15
|
* Creates a directory (recursive).
|
|
16
16
|
* @param targetPath - Directory path to create
|
|
17
17
|
*/
|
|
18
|
-
export declare function
|
|
18
|
+
export declare function mkdirSync(targetPath: string): void;
|
|
19
19
|
/**
|
|
20
20
|
* Creates a directory (recursive, asynchronous).
|
|
21
21
|
* @param targetPath - Directory path to create
|
|
22
22
|
*/
|
|
23
|
-
export declare function
|
|
23
|
+
export declare function mkdir(targetPath: string): Promise<void>;
|
|
24
24
|
/**
|
|
25
25
|
* Deletes a file or directory.
|
|
26
26
|
* @param targetPath - Path to delete
|
|
27
|
-
* @remarks The synchronous version fails immediately without retries. Use
|
|
27
|
+
* @remarks The synchronous version fails immediately without retries. Use rm for cases with potential transient errors like file locks.
|
|
28
28
|
*/
|
|
29
|
-
export declare function
|
|
29
|
+
export declare function rmSync(targetPath: string): void;
|
|
30
30
|
/**
|
|
31
31
|
* Deletes a file or directory (asynchronous).
|
|
32
32
|
* @param targetPath - Path to delete
|
|
33
33
|
* @remarks The asynchronous version retries up to 6 times (500ms interval) for transient errors like file locks.
|
|
34
34
|
*/
|
|
35
|
-
export declare function
|
|
35
|
+
export declare function rm(targetPath: string): Promise<void>;
|
|
36
36
|
/**
|
|
37
37
|
* Copies a file or directory.
|
|
38
38
|
*
|
|
@@ -47,7 +47,7 @@ export declare function fsRm(targetPath: string): Promise<void>;
|
|
|
47
47
|
* the filter function is applied recursively to all children (direct and indirect).
|
|
48
48
|
* Returning false for a directory skips that directory and all its contents.
|
|
49
49
|
*/
|
|
50
|
-
export declare function
|
|
50
|
+
export declare function copySync(sourcePath: string, targetPath: string, filter?: (absolutePath: string) => boolean): void;
|
|
51
51
|
/**
|
|
52
52
|
* Copies a file or directory (asynchronous).
|
|
53
53
|
*
|
|
@@ -62,56 +62,56 @@ export declare function fsCopySync(sourcePath: string, targetPath: string, filte
|
|
|
62
62
|
* the filter function is applied recursively to all children (direct and indirect).
|
|
63
63
|
* Returning false for a directory skips that directory and all its contents.
|
|
64
64
|
*/
|
|
65
|
-
export declare function
|
|
65
|
+
export declare function copy(sourcePath: string, targetPath: string, filter?: (absolutePath: string) => boolean): Promise<void>;
|
|
66
66
|
/**
|
|
67
67
|
* Reads a file as a UTF-8 string.
|
|
68
68
|
* @param targetPath - Path of the file to read
|
|
69
69
|
*/
|
|
70
|
-
export declare function
|
|
70
|
+
export declare function readSync(targetPath: string): string;
|
|
71
71
|
/**
|
|
72
72
|
* Reads a file as a UTF-8 string (asynchronous).
|
|
73
73
|
* @param targetPath - Path of the file to read
|
|
74
74
|
*/
|
|
75
|
-
export declare function
|
|
75
|
+
export declare function read(targetPath: string): Promise<string>;
|
|
76
76
|
/**
|
|
77
77
|
* Reads a file as a Buffer.
|
|
78
78
|
* @param targetPath - Path of the file to read
|
|
79
79
|
*/
|
|
80
|
-
export declare function
|
|
80
|
+
export declare function readBufferSync(targetPath: string): Buffer;
|
|
81
81
|
/**
|
|
82
82
|
* Reads a file as a Buffer (asynchronous).
|
|
83
83
|
* @param targetPath - Path of the file to read
|
|
84
84
|
*/
|
|
85
|
-
export declare function
|
|
85
|
+
export declare function readBuffer(targetPath: string): Promise<Buffer>;
|
|
86
86
|
/**
|
|
87
87
|
* Reads a JSON file (using JsonConvert).
|
|
88
88
|
* @param targetPath - Path of the JSON file to read
|
|
89
89
|
*/
|
|
90
|
-
export declare function
|
|
90
|
+
export declare function readJsonSync<TData = unknown>(targetPath: string): TData;
|
|
91
91
|
/**
|
|
92
92
|
* Reads a JSON file (using JsonConvert, asynchronous).
|
|
93
93
|
* @param targetPath - Path of the JSON file to read
|
|
94
94
|
*/
|
|
95
|
-
export declare function
|
|
95
|
+
export declare function readJson<TData = unknown>(targetPath: string): Promise<TData>;
|
|
96
96
|
/**
|
|
97
97
|
* Writes data to a file (auto-creates parent directories).
|
|
98
98
|
* @param targetPath - Path of the file to write
|
|
99
99
|
* @param data - Data to write (string or binary)
|
|
100
100
|
*/
|
|
101
|
-
export declare function
|
|
101
|
+
export declare function writeSync(targetPath: string, data: string | Uint8Array): void;
|
|
102
102
|
/**
|
|
103
103
|
* Writes data to a file (auto-creates parent directories, asynchronous).
|
|
104
104
|
* @param targetPath - Path of the file to write
|
|
105
105
|
* @param data - Data to write (string or binary)
|
|
106
106
|
*/
|
|
107
|
-
export declare function
|
|
107
|
+
export declare function write(targetPath: string, data: string | Uint8Array): Promise<void>;
|
|
108
108
|
/**
|
|
109
109
|
* Writes data to a JSON file (using JsonConvert).
|
|
110
110
|
* @param targetPath - Path of the JSON file to write
|
|
111
111
|
* @param data - Data to write
|
|
112
112
|
* @param options - JSON serialization options
|
|
113
113
|
*/
|
|
114
|
-
export declare function
|
|
114
|
+
export declare function writeJsonSync(targetPath: string, data: unknown, options?: {
|
|
115
115
|
replacer?: (this: unknown, key: string | undefined, value: unknown) => unknown;
|
|
116
116
|
space?: string | number;
|
|
117
117
|
}): void;
|
|
@@ -121,7 +121,7 @@ export declare function fsWriteJsonSync(targetPath: string, data: unknown, optio
|
|
|
121
121
|
* @param data - Data to write
|
|
122
122
|
* @param options - JSON serialization options
|
|
123
123
|
*/
|
|
124
|
-
export declare function
|
|
124
|
+
export declare function writeJson(targetPath: string, data: unknown, options?: {
|
|
125
125
|
replacer?: (this: unknown, key: string | undefined, value: unknown) => unknown;
|
|
126
126
|
space?: string | number;
|
|
127
127
|
}): Promise<void>;
|
|
@@ -129,51 +129,51 @@ export declare function fsWriteJson(targetPath: string, data: unknown, options?:
|
|
|
129
129
|
* Reads the contents of a directory.
|
|
130
130
|
* @param targetPath - Path of the directory to read
|
|
131
131
|
*/
|
|
132
|
-
export declare function
|
|
132
|
+
export declare function readdirSync(targetPath: string): string[];
|
|
133
133
|
/**
|
|
134
134
|
* Reads the contents of a directory (asynchronous).
|
|
135
135
|
* @param targetPath - Path of the directory to read
|
|
136
136
|
*/
|
|
137
|
-
export declare function
|
|
137
|
+
export declare function readdir(targetPath: string): Promise<string[]>;
|
|
138
138
|
/**
|
|
139
139
|
* Gets file/directory information (follows symbolic links).
|
|
140
140
|
* @param targetPath - Path to query information for
|
|
141
141
|
*/
|
|
142
|
-
export declare function
|
|
142
|
+
export declare function statSync(targetPath: string): fs.Stats;
|
|
143
143
|
/**
|
|
144
144
|
* Gets file/directory information (follows symbolic links, asynchronous).
|
|
145
145
|
* @param targetPath - Path to query information for
|
|
146
146
|
*/
|
|
147
|
-
export declare function
|
|
147
|
+
export declare function stat(targetPath: string): Promise<fs.Stats>;
|
|
148
148
|
/**
|
|
149
149
|
* Gets file/directory information (does not follow symbolic links).
|
|
150
150
|
* @param targetPath - Path to query information for
|
|
151
151
|
*/
|
|
152
|
-
export declare function
|
|
152
|
+
export declare function lstatSync(targetPath: string): fs.Stats;
|
|
153
153
|
/**
|
|
154
154
|
* Gets file/directory information (does not follow symbolic links, asynchronous).
|
|
155
155
|
* @param targetPath - Path to query information for
|
|
156
156
|
*/
|
|
157
|
-
export declare function
|
|
157
|
+
export declare function lstat(targetPath: string): Promise<fs.Stats>;
|
|
158
158
|
/**
|
|
159
159
|
* Searches for files using a glob pattern.
|
|
160
160
|
* @param pattern - Glob pattern (e.g., "**\/*.ts")
|
|
161
161
|
* @param options - glob options
|
|
162
162
|
* @returns Array of absolute paths for matched files
|
|
163
163
|
*/
|
|
164
|
-
export declare function
|
|
164
|
+
export declare function globSync(pattern: string, options?: GlobOptions): string[];
|
|
165
165
|
/**
|
|
166
166
|
* Searches for files using a glob pattern (asynchronous).
|
|
167
167
|
* @param pattern - Glob pattern (e.g., "**\/*.ts")
|
|
168
168
|
* @param options - glob options
|
|
169
169
|
* @returns Array of absolute paths for matched files
|
|
170
170
|
*/
|
|
171
|
-
export declare function
|
|
171
|
+
export declare function glob(pattern: string, options?: GlobOptions): Promise<string[]>;
|
|
172
172
|
/**
|
|
173
173
|
* Recursively searches and deletes empty directories under a specified directory.
|
|
174
174
|
* If all child directories are deleted and a parent becomes empty, it will also be deleted.
|
|
175
175
|
*/
|
|
176
|
-
export declare function
|
|
176
|
+
export declare function clearEmptyDirectory(dirPath: string): Promise<void>;
|
|
177
177
|
/**
|
|
178
178
|
* Searches for files matching a glob pattern by traversing parent directories from a start path towards the root.
|
|
179
179
|
* Collects all file paths matching the childGlob pattern in each directory.
|
|
@@ -183,7 +183,7 @@ export declare function fsClearEmptyDirectory(dirPath: string): Promise<void>;
|
|
|
183
183
|
* **Note**: fromPath must be a child path of rootPath.
|
|
184
184
|
* Otherwise, searches to the filesystem root.
|
|
185
185
|
*/
|
|
186
|
-
export declare function
|
|
186
|
+
export declare function findAllParentChildPathsSync(childGlob: string, fromPath: string, rootPath?: string): string[];
|
|
187
187
|
/**
|
|
188
188
|
* Searches for files matching a glob pattern by traversing parent directories from a start path towards the root (asynchronous).
|
|
189
189
|
* Collects all file paths matching the childGlob pattern in each directory.
|
|
@@ -193,5 +193,5 @@ export declare function fsFindAllParentChildPathsSync(childGlob: string, fromPat
|
|
|
193
193
|
* **Note**: fromPath must be a child path of rootPath.
|
|
194
194
|
* Otherwise, searches to the filesystem root.
|
|
195
195
|
*/
|
|
196
|
-
export declare function
|
|
196
|
+
export declare function findAllParentChildPaths(childGlob: string, fromPath: string, rootPath?: string): Promise<string[]>;
|
|
197
197
|
//# sourceMappingURL=fs.d.ts.map
|
package/dist/utils/fs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["..\\..\\src\\utils\\fs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,EAAmB,KAAK,WAAW,EAA2B,MAAM,MAAM,CAAC;AAElF,OAAO,uBAAuB,CAAC;AAI/B;;;GAGG;AACH,wBAAgB,
|
|
1
|
+
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["..\\..\\src\\ut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B"}
|
package/dist/utils/fs.js
CHANGED
|
@@ -2,12 +2,12 @@ import path from "path";
|
|
|
2
2
|
import fs from "fs";
|
|
3
3
|
import os from "os";
|
|
4
4
|
import { glob as globRaw, globSync as globRawSync } from "glob";
|
|
5
|
-
import {
|
|
5
|
+
import { json, SdError } from "@simplysm/core-common";
|
|
6
6
|
import "@simplysm/core-common";
|
|
7
|
-
function
|
|
7
|
+
function existsSync(targetPath) {
|
|
8
8
|
return fs.existsSync(targetPath);
|
|
9
9
|
}
|
|
10
|
-
async function
|
|
10
|
+
async function exists(targetPath) {
|
|
11
11
|
try {
|
|
12
12
|
await fs.promises.access(targetPath);
|
|
13
13
|
return true;
|
|
@@ -15,28 +15,28 @@ async function fsExists(targetPath) {
|
|
|
15
15
|
return false;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function mkdirSync(targetPath) {
|
|
19
19
|
try {
|
|
20
20
|
fs.mkdirSync(targetPath, { recursive: true });
|
|
21
21
|
} catch (err) {
|
|
22
22
|
throw new SdError(err, targetPath);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
async function
|
|
25
|
+
async function mkdir(targetPath) {
|
|
26
26
|
try {
|
|
27
27
|
await fs.promises.mkdir(targetPath, { recursive: true });
|
|
28
28
|
} catch (err) {
|
|
29
29
|
throw new SdError(err, targetPath);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function rmSync(targetPath) {
|
|
33
33
|
try {
|
|
34
34
|
fs.rmSync(targetPath, { recursive: true, force: true });
|
|
35
35
|
} catch (err) {
|
|
36
36
|
throw new SdError(err, targetPath);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
async function
|
|
39
|
+
async function rm(targetPath) {
|
|
40
40
|
try {
|
|
41
41
|
await fs.promises.rm(targetPath, {
|
|
42
42
|
recursive: true,
|
|
@@ -48,8 +48,20 @@ async function fsRm(targetPath) {
|
|
|
48
48
|
throw new SdError(err, targetPath);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
|
|
51
|
+
function collectCopyEntries(sourcePath, targetPath, children, filter) {
|
|
52
|
+
const entries = [];
|
|
53
|
+
for (const childPath of children) {
|
|
54
|
+
if (filter !== void 0 && !filter(childPath)) {
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
const relativeChildPath = path.relative(sourcePath, childPath);
|
|
58
|
+
const childTargetPath = path.resolve(targetPath, relativeChildPath);
|
|
59
|
+
entries.push({ sourcePath: childPath, targetPath: childTargetPath });
|
|
60
|
+
}
|
|
61
|
+
return entries;
|
|
62
|
+
}
|
|
63
|
+
function copySync(sourcePath, targetPath, filter) {
|
|
64
|
+
if (!existsSync(sourcePath)) {
|
|
53
65
|
return;
|
|
54
66
|
}
|
|
55
67
|
let stats;
|
|
@@ -59,18 +71,13 @@ function fsCopySync(sourcePath, targetPath, filter) {
|
|
|
59
71
|
throw new SdError(err, sourcePath);
|
|
60
72
|
}
|
|
61
73
|
if (stats.isDirectory()) {
|
|
62
|
-
|
|
63
|
-
const children =
|
|
64
|
-
for (const
|
|
65
|
-
|
|
66
|
-
continue;
|
|
67
|
-
}
|
|
68
|
-
const relativeChildPath = path.relative(sourcePath, childPath);
|
|
69
|
-
const childTargetPath = path.resolve(targetPath, relativeChildPath);
|
|
70
|
-
fsCopySync(childPath, childTargetPath, filter);
|
|
74
|
+
mkdirSync(targetPath);
|
|
75
|
+
const children = globSync(path.resolve(sourcePath, "*"), { dot: true });
|
|
76
|
+
for (const entry of collectCopyEntries(sourcePath, targetPath, children, filter)) {
|
|
77
|
+
copySync(entry.sourcePath, entry.targetPath, filter);
|
|
71
78
|
}
|
|
72
79
|
} else {
|
|
73
|
-
|
|
80
|
+
mkdirSync(path.dirname(targetPath));
|
|
74
81
|
try {
|
|
75
82
|
fs.copyFileSync(sourcePath, targetPath);
|
|
76
83
|
} catch (err) {
|
|
@@ -78,8 +85,8 @@ function fsCopySync(sourcePath, targetPath, filter) {
|
|
|
78
85
|
}
|
|
79
86
|
}
|
|
80
87
|
}
|
|
81
|
-
async function
|
|
82
|
-
if (!await
|
|
88
|
+
async function copy(sourcePath, targetPath, filter) {
|
|
89
|
+
if (!await exists(sourcePath)) {
|
|
83
90
|
return;
|
|
84
91
|
}
|
|
85
92
|
let stats;
|
|
@@ -89,18 +96,13 @@ async function fsCopy(sourcePath, targetPath, filter) {
|
|
|
89
96
|
throw new SdError(err, sourcePath);
|
|
90
97
|
}
|
|
91
98
|
if (stats.isDirectory()) {
|
|
92
|
-
await
|
|
93
|
-
const children = await
|
|
94
|
-
await children.parallelAsync(async (
|
|
95
|
-
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
const relativeChildPath = path.relative(sourcePath, childPath);
|
|
99
|
-
const childTargetPath = path.resolve(targetPath, relativeChildPath);
|
|
100
|
-
await fsCopy(childPath, childTargetPath, filter);
|
|
99
|
+
await mkdir(targetPath);
|
|
100
|
+
const children = await glob(path.resolve(sourcePath, "*"), { dot: true });
|
|
101
|
+
await collectCopyEntries(sourcePath, targetPath, children, filter).parallelAsync(async (entry) => {
|
|
102
|
+
await copy(entry.sourcePath, entry.targetPath, filter);
|
|
101
103
|
});
|
|
102
104
|
} else {
|
|
103
|
-
await
|
|
105
|
+
await mkdir(path.dirname(targetPath));
|
|
104
106
|
try {
|
|
105
107
|
await fs.promises.copyFile(sourcePath, targetPath);
|
|
106
108
|
} catch (err) {
|
|
@@ -108,151 +110,151 @@ async function fsCopy(sourcePath, targetPath, filter) {
|
|
|
108
110
|
}
|
|
109
111
|
}
|
|
110
112
|
}
|
|
111
|
-
function
|
|
113
|
+
function readSync(targetPath) {
|
|
112
114
|
try {
|
|
113
115
|
return fs.readFileSync(targetPath, "utf-8");
|
|
114
116
|
} catch (err) {
|
|
115
117
|
throw new SdError(err, targetPath);
|
|
116
118
|
}
|
|
117
119
|
}
|
|
118
|
-
async function
|
|
120
|
+
async function read(targetPath) {
|
|
119
121
|
try {
|
|
120
122
|
return await fs.promises.readFile(targetPath, "utf-8");
|
|
121
123
|
} catch (err) {
|
|
122
124
|
throw new SdError(err, targetPath);
|
|
123
125
|
}
|
|
124
126
|
}
|
|
125
|
-
function
|
|
127
|
+
function readBufferSync(targetPath) {
|
|
126
128
|
try {
|
|
127
129
|
return fs.readFileSync(targetPath);
|
|
128
130
|
} catch (err) {
|
|
129
131
|
throw new SdError(err, targetPath);
|
|
130
132
|
}
|
|
131
133
|
}
|
|
132
|
-
async function
|
|
134
|
+
async function readBuffer(targetPath) {
|
|
133
135
|
try {
|
|
134
136
|
return await fs.promises.readFile(targetPath);
|
|
135
137
|
} catch (err) {
|
|
136
138
|
throw new SdError(err, targetPath);
|
|
137
139
|
}
|
|
138
140
|
}
|
|
139
|
-
function
|
|
140
|
-
const contents =
|
|
141
|
+
function readJsonSync(targetPath) {
|
|
142
|
+
const contents = readSync(targetPath);
|
|
141
143
|
try {
|
|
142
|
-
return
|
|
144
|
+
return json.parse(contents);
|
|
143
145
|
} catch (err) {
|
|
144
146
|
const preview = contents.length > 500 ? contents.slice(0, 500) + "...(truncated)" : contents;
|
|
145
147
|
throw new SdError(err, targetPath + os.EOL + preview);
|
|
146
148
|
}
|
|
147
149
|
}
|
|
148
|
-
async function
|
|
149
|
-
const contents = await
|
|
150
|
+
async function readJson(targetPath) {
|
|
151
|
+
const contents = await read(targetPath);
|
|
150
152
|
try {
|
|
151
|
-
return
|
|
153
|
+
return json.parse(contents);
|
|
152
154
|
} catch (err) {
|
|
153
155
|
const preview = contents.length > 500 ? contents.slice(0, 500) + "...(truncated)" : contents;
|
|
154
156
|
throw new SdError(err, targetPath + os.EOL + preview);
|
|
155
157
|
}
|
|
156
158
|
}
|
|
157
|
-
function
|
|
158
|
-
|
|
159
|
+
function writeSync(targetPath, data) {
|
|
160
|
+
mkdirSync(path.dirname(targetPath));
|
|
159
161
|
try {
|
|
160
162
|
fs.writeFileSync(targetPath, data, { flush: true });
|
|
161
163
|
} catch (err) {
|
|
162
164
|
throw new SdError(err, targetPath);
|
|
163
165
|
}
|
|
164
166
|
}
|
|
165
|
-
async function
|
|
166
|
-
await
|
|
167
|
+
async function write(targetPath, data) {
|
|
168
|
+
await mkdir(path.dirname(targetPath));
|
|
167
169
|
try {
|
|
168
170
|
await fs.promises.writeFile(targetPath, data, { flush: true });
|
|
169
171
|
} catch (err) {
|
|
170
172
|
throw new SdError(err, targetPath);
|
|
171
173
|
}
|
|
172
174
|
}
|
|
173
|
-
function
|
|
174
|
-
const
|
|
175
|
-
|
|
175
|
+
function writeJsonSync(targetPath, data, options) {
|
|
176
|
+
const jsonStr = json.stringify(data, options);
|
|
177
|
+
writeSync(targetPath, jsonStr);
|
|
176
178
|
}
|
|
177
|
-
async function
|
|
178
|
-
const
|
|
179
|
-
await
|
|
179
|
+
async function writeJson(targetPath, data, options) {
|
|
180
|
+
const jsonStr = json.stringify(data, options);
|
|
181
|
+
await write(targetPath, jsonStr);
|
|
180
182
|
}
|
|
181
|
-
function
|
|
183
|
+
function readdirSync(targetPath) {
|
|
182
184
|
try {
|
|
183
185
|
return fs.readdirSync(targetPath);
|
|
184
186
|
} catch (err) {
|
|
185
187
|
throw new SdError(err, targetPath);
|
|
186
188
|
}
|
|
187
189
|
}
|
|
188
|
-
async function
|
|
190
|
+
async function readdir(targetPath) {
|
|
189
191
|
try {
|
|
190
192
|
return await fs.promises.readdir(targetPath);
|
|
191
193
|
} catch (err) {
|
|
192
194
|
throw new SdError(err, targetPath);
|
|
193
195
|
}
|
|
194
196
|
}
|
|
195
|
-
function
|
|
197
|
+
function statSync(targetPath) {
|
|
196
198
|
try {
|
|
197
199
|
return fs.statSync(targetPath);
|
|
198
200
|
} catch (err) {
|
|
199
201
|
throw new SdError(err, targetPath);
|
|
200
202
|
}
|
|
201
203
|
}
|
|
202
|
-
async function
|
|
204
|
+
async function stat(targetPath) {
|
|
203
205
|
try {
|
|
204
206
|
return await fs.promises.stat(targetPath);
|
|
205
207
|
} catch (err) {
|
|
206
208
|
throw new SdError(err, targetPath);
|
|
207
209
|
}
|
|
208
210
|
}
|
|
209
|
-
function
|
|
211
|
+
function lstatSync(targetPath) {
|
|
210
212
|
try {
|
|
211
213
|
return fs.lstatSync(targetPath);
|
|
212
214
|
} catch (err) {
|
|
213
215
|
throw new SdError(err, targetPath);
|
|
214
216
|
}
|
|
215
217
|
}
|
|
216
|
-
async function
|
|
218
|
+
async function lstat(targetPath) {
|
|
217
219
|
try {
|
|
218
220
|
return await fs.promises.lstat(targetPath);
|
|
219
221
|
} catch (err) {
|
|
220
222
|
throw new SdError(err, targetPath);
|
|
221
223
|
}
|
|
222
224
|
}
|
|
223
|
-
function
|
|
225
|
+
function globSync(pattern, options) {
|
|
224
226
|
return globRawSync(pattern.replace(/\\/g, "/"), options ?? {}).map(
|
|
225
227
|
(item) => path.resolve(item.toString())
|
|
226
228
|
);
|
|
227
229
|
}
|
|
228
|
-
async function
|
|
230
|
+
async function glob(pattern, options) {
|
|
229
231
|
return (await globRaw(pattern.replace(/\\/g, "/"), options ?? {})).map(
|
|
230
232
|
(item) => path.resolve(item.toString())
|
|
231
233
|
);
|
|
232
234
|
}
|
|
233
|
-
async function
|
|
234
|
-
if (!await
|
|
235
|
-
const childNames = await
|
|
235
|
+
async function clearEmptyDirectory(dirPath) {
|
|
236
|
+
if (!await exists(dirPath)) return;
|
|
237
|
+
const childNames = await readdir(dirPath);
|
|
236
238
|
let hasFiles = false;
|
|
237
239
|
for (const childName of childNames) {
|
|
238
240
|
const childPath = path.resolve(dirPath, childName);
|
|
239
|
-
if ((await
|
|
240
|
-
await
|
|
241
|
+
if ((await lstat(childPath)).isDirectory()) {
|
|
242
|
+
await clearEmptyDirectory(childPath);
|
|
241
243
|
} else {
|
|
242
244
|
hasFiles = true;
|
|
243
245
|
}
|
|
244
246
|
}
|
|
245
247
|
if (hasFiles) return;
|
|
246
|
-
if ((await
|
|
247
|
-
await
|
|
248
|
+
if ((await readdir(dirPath)).length === 0) {
|
|
249
|
+
await rm(dirPath);
|
|
248
250
|
}
|
|
249
251
|
}
|
|
250
|
-
function
|
|
252
|
+
function findAllParentChildPathsSync(childGlob, fromPath, rootPath) {
|
|
251
253
|
const resultPaths = [];
|
|
252
254
|
let current = fromPath;
|
|
253
255
|
while (current) {
|
|
254
256
|
const potential = path.resolve(current, childGlob);
|
|
255
|
-
const globResults =
|
|
257
|
+
const globResults = globSync(potential);
|
|
256
258
|
resultPaths.push(...globResults);
|
|
257
259
|
if (current === rootPath) break;
|
|
258
260
|
const next = path.dirname(current);
|
|
@@ -261,12 +263,12 @@ function fsFindAllParentChildPathsSync(childGlob, fromPath, rootPath) {
|
|
|
261
263
|
}
|
|
262
264
|
return resultPaths;
|
|
263
265
|
}
|
|
264
|
-
async function
|
|
266
|
+
async function findAllParentChildPaths(childGlob, fromPath, rootPath) {
|
|
265
267
|
const resultPaths = [];
|
|
266
268
|
let current = fromPath;
|
|
267
269
|
while (current) {
|
|
268
270
|
const potential = path.resolve(current, childGlob);
|
|
269
|
-
const globResults = await
|
|
271
|
+
const globResults = await glob(potential);
|
|
270
272
|
resultPaths.push(...globResults);
|
|
271
273
|
if (current === rootPath) break;
|
|
272
274
|
const next = path.dirname(current);
|
|
@@ -276,34 +278,34 @@ async function fsFindAllParentChildPaths(childGlob, fromPath, rootPath) {
|
|
|
276
278
|
return resultPaths;
|
|
277
279
|
}
|
|
278
280
|
export {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
281
|
+
clearEmptyDirectory,
|
|
282
|
+
copy,
|
|
283
|
+
copySync,
|
|
284
|
+
exists,
|
|
285
|
+
existsSync,
|
|
286
|
+
findAllParentChildPaths,
|
|
287
|
+
findAllParentChildPathsSync,
|
|
288
|
+
glob,
|
|
289
|
+
globSync,
|
|
290
|
+
lstat,
|
|
291
|
+
lstatSync,
|
|
292
|
+
mkdir,
|
|
293
|
+
mkdirSync,
|
|
294
|
+
read,
|
|
295
|
+
readBuffer,
|
|
296
|
+
readBufferSync,
|
|
297
|
+
readJson,
|
|
298
|
+
readJsonSync,
|
|
299
|
+
readSync,
|
|
300
|
+
readdir,
|
|
301
|
+
readdirSync,
|
|
302
|
+
rm,
|
|
303
|
+
rmSync,
|
|
304
|
+
stat,
|
|
305
|
+
statSync,
|
|
306
|
+
write,
|
|
307
|
+
writeJson,
|
|
308
|
+
writeJsonSync,
|
|
309
|
+
writeSync
|
|
308
310
|
};
|
|
309
311
|
//# sourceMappingURL=fs.js.map
|
package/dist/utils/fs.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/fs.ts"],
|
|
4
|
-
"mappings": "AAAA,OAAO,UAAU;AACjB,OAAO,QAAQ;AACf,OAAO,QAAQ;AACf,SAAS,QAAQ,SAA2B,YAAY,mBAAmB;AAC3E,SAAS,
|
|
4
|
+
"mappings": "AAAA,OAAO,UAAU;AACjB,OAAO,QAAQ;AACf,OAAO,QAAQ;AACf,SAAS,QAAQ,SAA2B,YAAY,mBAAmB;AAC3E,SAAS,MAAM,eAAe;AAC9B,OAAO;AAQA,SAAS,WAAW,YAA6B;AACtD,SAAO,GAAG,WAAW,UAAU;AACjC;AAMA,eAAsB,OAAO,YAAsC;AACjE,MAAI;AACF,UAAM,GAAG,SAAS,OAAO,UAAU;AACnC,WAAO;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAUO,SAAS,UAAU,YAA0B;AAClD,MAAI;AACF,O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