@vibe-agent-toolkit/utils 0.1.24 → 0.1.25-rc.1
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/dist/path-utils.d.ts +6 -5
- package/dist/path-utils.d.ts.map +1 -1
- package/dist/path-utils.js +9 -8
- package/dist/path-utils.js.map +1 -1
- package/package.json +1 -1
package/dist/path-utils.d.ts
CHANGED
|
@@ -12,7 +12,8 @@ import { mkdirSync } from 'node:fs';
|
|
|
12
12
|
* - realpathSync.native() resolves these to their actual filesystem paths
|
|
13
13
|
*
|
|
14
14
|
* @param paths - Path segments to join and normalize
|
|
15
|
-
* @returns Real (normalized) path
|
|
15
|
+
* @returns Real (normalized) path with **OS-native separators** (backslashes on Windows).
|
|
16
|
+
* Use `toForwardSlash()` if you need forward slashes for string comparison or display.
|
|
16
17
|
*
|
|
17
18
|
* @example
|
|
18
19
|
* ```typescript
|
|
@@ -45,7 +46,7 @@ export declare function normalizePath(...paths: string[]): string;
|
|
|
45
46
|
* - Tests using SHORT paths from tmpdir() will fail existsSync() checks
|
|
46
47
|
* - This is a "works on Mac, fails on Windows CI" bug pattern
|
|
47
48
|
*
|
|
48
|
-
* @returns Normalized temp directory path (resolves short names on Windows)
|
|
49
|
+
* @returns Normalized temp directory path with **OS-native separators** (resolves short names on Windows)
|
|
49
50
|
*
|
|
50
51
|
* @example
|
|
51
52
|
* ```typescript
|
|
@@ -70,7 +71,7 @@ export declare function normalizedTmpdir(): string;
|
|
|
70
71
|
*
|
|
71
72
|
* @param path - Directory path to create
|
|
72
73
|
* @param options - Options for mkdirSync (e.g., recursive: true)
|
|
73
|
-
* @returns Real (normalized) path to the created directory
|
|
74
|
+
* @returns Real (normalized) path to the created directory with **OS-native separators**
|
|
74
75
|
*
|
|
75
76
|
* @example
|
|
76
77
|
* ```typescript
|
|
@@ -113,7 +114,7 @@ export declare function isAbsolutePath(p: string): boolean;
|
|
|
113
114
|
*
|
|
114
115
|
* @param p - Path to convert
|
|
115
116
|
* @param baseDir - Base directory for resolution
|
|
116
|
-
* @returns Absolute path
|
|
117
|
+
* @returns Absolute path with **forward slashes** (cross-platform safe)
|
|
117
118
|
*
|
|
118
119
|
* @example
|
|
119
120
|
* toAbsolutePath('./docs/README.md', '/project')
|
|
@@ -130,7 +131,7 @@ export declare function toAbsolutePath(p: string, baseDir: string): string;
|
|
|
130
131
|
*
|
|
131
132
|
* @param from - Source file path (absolute)
|
|
132
133
|
* @param to - Target file path (absolute)
|
|
133
|
-
* @returns Relative path from source to target
|
|
134
|
+
* @returns Relative path from source to target with **forward slashes** (cross-platform safe)
|
|
134
135
|
*
|
|
135
136
|
* @example
|
|
136
137
|
* getRelativePath('/project/docs/guide.md', '/project/README.md')
|
package/dist/path-utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path-utils.d.ts","sourceRoot":"","sources":["../src/path-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAgB,MAAM,SAAS,CAAC;AAIlD
|
|
1
|
+
{"version":3,"file":"path-utils.d.ts","sourceRoot":"","sources":["../src/path-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAgB,MAAM,SAAS,CAAC;AAIlD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,aAAa,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CA+BxD;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAezC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,GACxC,MAAM,CAiBR;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAKjE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAMhE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,QAAQ;IACnB,6DAA6D;8BAC9C,MAAM,EAAE,KAAG,MAAM;IAIhC,gEAAgE;iCAC9C,MAAM,EAAE,KAAG,MAAM;IAInC,iEAAiE;8BAClD,MAAM,MAAM,MAAM,KAAG,MAAM;CAGlC,CAAC"}
|
package/dist/path-utils.js
CHANGED
|
@@ -14,7 +14,8 @@ import path from 'node:path';
|
|
|
14
14
|
* - realpathSync.native() resolves these to their actual filesystem paths
|
|
15
15
|
*
|
|
16
16
|
* @param paths - Path segments to join and normalize
|
|
17
|
-
* @returns Real (normalized) path
|
|
17
|
+
* @returns Real (normalized) path with **OS-native separators** (backslashes on Windows).
|
|
18
|
+
* Use `toForwardSlash()` if you need forward slashes for string comparison or display.
|
|
18
19
|
*
|
|
19
20
|
* @example
|
|
20
21
|
* ```typescript
|
|
@@ -80,7 +81,7 @@ export function normalizePath(...paths) {
|
|
|
80
81
|
* - Tests using SHORT paths from tmpdir() will fail existsSync() checks
|
|
81
82
|
* - This is a "works on Mac, fails on Windows CI" bug pattern
|
|
82
83
|
*
|
|
83
|
-
* @returns Normalized temp directory path (resolves short names on Windows)
|
|
84
|
+
* @returns Normalized temp directory path with **OS-native separators** (resolves short names on Windows)
|
|
84
85
|
*
|
|
85
86
|
* @example
|
|
86
87
|
* ```typescript
|
|
@@ -122,7 +123,7 @@ export function normalizedTmpdir() {
|
|
|
122
123
|
*
|
|
123
124
|
* @param path - Directory path to create
|
|
124
125
|
* @param options - Options for mkdirSync (e.g., recursive: true)
|
|
125
|
-
* @returns Real (normalized) path to the created directory
|
|
126
|
+
* @returns Real (normalized) path to the created directory with **OS-native separators**
|
|
126
127
|
*
|
|
127
128
|
* @example
|
|
128
129
|
* ```typescript
|
|
@@ -185,7 +186,7 @@ export function isAbsolutePath(p) {
|
|
|
185
186
|
*
|
|
186
187
|
* @param p - Path to convert
|
|
187
188
|
* @param baseDir - Base directory for resolution
|
|
188
|
-
* @returns Absolute path
|
|
189
|
+
* @returns Absolute path with **forward slashes** (cross-platform safe)
|
|
189
190
|
*
|
|
190
191
|
* @example
|
|
191
192
|
* toAbsolutePath('./docs/README.md', '/project')
|
|
@@ -196,9 +197,9 @@ export function isAbsolutePath(p) {
|
|
|
196
197
|
*/
|
|
197
198
|
export function toAbsolutePath(p, baseDir) {
|
|
198
199
|
if (path.isAbsolute(p)) {
|
|
199
|
-
return path.normalize(p);
|
|
200
|
+
return toForwardSlash(path.normalize(p));
|
|
200
201
|
}
|
|
201
|
-
return path.resolve(baseDir, p);
|
|
202
|
+
return toForwardSlash(path.resolve(baseDir, p));
|
|
202
203
|
}
|
|
203
204
|
/**
|
|
204
205
|
* Get the relative path from one file to another
|
|
@@ -207,7 +208,7 @@ export function toAbsolutePath(p, baseDir) {
|
|
|
207
208
|
*
|
|
208
209
|
* @param from - Source file path (absolute)
|
|
209
210
|
* @param to - Target file path (absolute)
|
|
210
|
-
* @returns Relative path from source to target
|
|
211
|
+
* @returns Relative path from source to target with **forward slashes** (cross-platform safe)
|
|
211
212
|
*
|
|
212
213
|
* @example
|
|
213
214
|
* getRelativePath('/project/docs/guide.md', '/project/README.md')
|
|
@@ -220,7 +221,7 @@ export function getRelativePath(from, to) {
|
|
|
220
221
|
// Get directory of source file (not the file itself)
|
|
221
222
|
const fromDir = path.dirname(from);
|
|
222
223
|
// Calculate relative path from source directory to target file
|
|
223
|
-
return path.relative(fromDir, to);
|
|
224
|
+
return toForwardSlash(path.relative(fromDir, to));
|
|
224
225
|
}
|
|
225
226
|
/**
|
|
226
227
|
* Convert a path to forward slashes
|
package/dist/path-utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path-utils.js","sourceRoot":"","sources":["../src/path-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B
|
|
1
|
+
{"version":3,"file":"path-utils.js","sourceRoot":"","sources":["../src/path-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,UAAU,aAAa,CAAC,GAAG,KAAe;IAC9C,4DAA4D;IAC5D,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACjE,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IAED,2BAA2B;IAC3B,iGAAiG;IACjG,4CAA4C;IAC5C,IAAI,QAAgB,CAAC;IACrB,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC5B,CAAC;SAAM,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9B,QAAQ,GAAG,IAAI,CAAC,OA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