@beehexa/hexasync-template-io-node 2610.4.3 → 2610.4.5
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/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -8
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,10 @@ export declare function uriFromPath(path: string): string;
|
|
|
9
9
|
* 1.5 is structured to avoid.
|
|
10
10
|
*/
|
|
11
11
|
export declare function pathFromUri(uri: string): string;
|
|
12
|
-
|
|
12
|
+
/** Optional traversal exclusions and cancellation; omitted options retain the general reader. */
|
|
13
|
+
export declare function nodeTemplateReader(options?: {
|
|
14
|
+
ignoredPathSegments?: readonly string[];
|
|
15
|
+
signal?: AbortSignal;
|
|
16
|
+
}): TemplateReader;
|
|
13
17
|
export declare function nodeIdentityResolver(): IdentityResolver;
|
|
14
18
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACf,MAAM,kCAAkC,CAAC;AAE1C,6CAA6C;AAC7C,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,wBAAgB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACf,MAAM,kCAAkC,CAAC;AAE1C,6CAA6C;AAC7C,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,iGAAiG;AACjG,wBAAgB,kBAAkB,CAAC,OAAO,GAAE;IAC1C,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,MAAM,CAAC,EAAE,WAAW,CAAC;CACjB,GAAG,cAAc,CAiDtB;AAED,wBAAgB,oBAAoB,IAAI,gBAAgB,CAevD"}
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import { readFile, stat, realpath } from 'node:fs/promises';
|
|
14
14
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
15
|
-
import
|
|
15
|
+
import { glob } from 'glob';
|
|
16
16
|
import { normalizeUri } from '@beehexa/hexasync-template-model';
|
|
17
17
|
/** A `file://` URI for a filesystem path. */
|
|
18
18
|
export function uriFromPath(path) {
|
|
@@ -28,11 +28,13 @@ export function uriFromPath(path) {
|
|
|
28
28
|
export function pathFromUri(uri) {
|
|
29
29
|
return uri.startsWith('file://') ? fileURLToPath(uri) : uri;
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
/** Optional traversal exclusions and cancellation; omitted options retain the general reader. */
|
|
32
|
+
export function nodeTemplateReader(options = {}) {
|
|
33
|
+
const ignored = options.ignoredPathSegments;
|
|
32
34
|
return {
|
|
33
35
|
async read(uri) {
|
|
34
36
|
try {
|
|
35
|
-
return await readFile(pathFromUri(uri), 'utf8');
|
|
37
|
+
return await readFile(pathFromUri(uri), { encoding: 'utf8', signal: options.signal });
|
|
36
38
|
}
|
|
37
39
|
catch (error) {
|
|
38
40
|
// ENOENT and EISDIR both mean "no file content here", an ordinary answer during
|
|
@@ -55,16 +57,26 @@ export function nodeTemplateReader() {
|
|
|
55
57
|
}
|
|
56
58
|
},
|
|
57
59
|
async glob(baseUri, pattern) {
|
|
58
|
-
const matches = await
|
|
60
|
+
const matches = await glob(pattern, {
|
|
59
61
|
cwd: pathFromUri(baseUri),
|
|
60
|
-
|
|
62
|
+
withFileTypes: true,
|
|
61
63
|
dot: false,
|
|
62
|
-
|
|
64
|
+
follow: false,
|
|
65
|
+
nodir: true,
|
|
66
|
+
nocase: false,
|
|
67
|
+
// Glob can follow one directory link even with follow:false; prune it during traversal.
|
|
68
|
+
ignore: {
|
|
69
|
+
childrenIgnored: (entry) => entry.isSymbolicLink() || ignored?.includes(entry.name) === true,
|
|
70
|
+
},
|
|
71
|
+
signal: options.signal,
|
|
63
72
|
});
|
|
64
|
-
// Sorted explicitly:
|
|
73
|
+
// Sorted explicitly: glob order follows directory traversal, and compose output must
|
|
65
74
|
// be byte-identical run to run (NFR-19). An unsorted glob would vary merge order and so the
|
|
66
75
|
// output — intermittently, and only on some filesystems.
|
|
67
|
-
return matches
|
|
76
|
+
return matches
|
|
77
|
+
.filter((entry) => !entry.isSymbolicLink())
|
|
78
|
+
.map((entry) => uriFromPath(entry.fullpath()))
|
|
79
|
+
.sort();
|
|
68
80
|
},
|
|
69
81
|
};
|
|
70
82
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAA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AC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beehexa/hexasync-template-io-node",
|
|
3
|
-
"version": "2610.4.
|
|
3
|
+
"version": "2610.4.5",
|
|
4
4
|
"description": "Node implementations of the port interfaces.",
|
|
5
5
|
"license": "SEE LICENSE IN ../../LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"build": "tsc -p tsconfig.build.json"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@beehexa/hexasync-template-model": "2610.4.
|
|
24
|
-
"@beehexa/hexasync-template-ports": "2610.4.
|
|
25
|
-
"
|
|
23
|
+
"@beehexa/hexasync-template-model": "2610.4.5",
|
|
24
|
+
"@beehexa/hexasync-template-ports": "2610.4.5",
|
|
25
|
+
"glob": "^13.0.6"
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|
|
@@ -31,6 +31,6 @@
|
|
|
31
31
|
"layer": "adapter"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@beehexa/hexasync-template-compose": "2610.4.
|
|
34
|
+
"@beehexa/hexasync-template-compose": "2610.4.5"
|
|
35
35
|
}
|
|
36
36
|
}
|