zephyr-agent 0.1.5-next.4 → 0.1.6-next.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/index.d.ts +1 -0
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/utils/read-dir-recursive.d.ts +27 -0
- package/dist/lib/utils/read-dir-recursive.js +49 -0
- package/dist/lib/utils/read-dir-recursive.js.map +1 -0
- package/dist/package.json +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { onIndexHtmlResolved, resolveIndexHtml } from './lib/hacks/resolve-index-html';
|
|
2
2
|
export { getPartialAssetMap, removePartialAssetMap, savePartialAssetMap, } from './lib/node-persist/partial-assets-map';
|
|
3
3
|
export { getGlobal } from './lib/utils/get-global';
|
|
4
|
+
export { readDirRecursive, readDirRecursiveWithContents, type FileInfo, } from './lib/utils/read-dir-recursive';
|
|
4
5
|
export { ZeErrors, ZephyrError } from './lib/errors';
|
|
5
6
|
export { handleGlobalError } from './lib/errors';
|
|
6
7
|
export { getAllAppDeployResults, getAllDeployedApps, getAppDeployResult, type DeployResult, } from './lib/node-persist/app-deploy-result-cache';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.generateManifestContent = exports.buildEnvJsonAsset = exports.injectBeforeHeadClose = exports.buildModulePreload = exports.injectImportMap = exports.buildImportMap = exports.detectEnvReads = exports.VIRTUAL_SPECIFIER = exports.rewriteEnvReadsToVirtualModule = exports.buildEnvModuleSource = exports.buildEnvImportMapScript = exports.buildEnvImportMap = exports.readPackageJson = exports.is_zephyr_dependency_pair = exports.ZephyrEngine = exports.TOKEN_EXPIRY = exports.DEFAULT_AUTH_COMPLETION_TIMEOUT_MS = exports.createZephyrManifest = exports.createManifestContent = exports.createManifestAsset = exports.convertResolvedDependencies = exports.zeBuildDashData = exports.buildAssetsMap = exports.zeBuildAssets = exports.normalizeBasePath = exports.applyBaseHrefToAssets = exports.getLogFormat = exports.getLogBasePath = exports.isFileLoggingEnabled = exports.writeRunSummary = exports.writeLogToFile = exports.resetLogRun = exports.getCurrentRunDir = exports.initializeLogRun = exports.logFn = exports.ze_log = exports.getAppDeployResult = exports.getAllDeployedApps = exports.getAllAppDeployResults = exports.handleGlobalError = exports.ZephyrError = exports.ZeErrors = exports.readDirRecursiveWithContents = exports.readDirRecursive = exports.getGlobal = exports.savePartialAssetMap = exports.removePartialAssetMap = exports.getPartialAssetMap = exports.resolveIndexHtml = exports.onIndexHtmlResolved = void 0;
|
|
4
|
+
exports.collectZEPublicVars = exports.calculateManifestHash = void 0;
|
|
4
5
|
// hack for angular
|
|
5
6
|
var resolve_index_html_1 = require("./lib/hacks/resolve-index-html");
|
|
6
7
|
Object.defineProperty(exports, "onIndexHtmlResolved", { enumerable: true, get: function () { return resolve_index_html_1.onIndexHtmlResolved; } });
|
|
@@ -13,6 +14,9 @@ Object.defineProperty(exports, "savePartialAssetMap", { enumerable: true, get: f
|
|
|
13
14
|
// global utilities
|
|
14
15
|
var get_global_1 = require("./lib/utils/get-global");
|
|
15
16
|
Object.defineProperty(exports, "getGlobal", { enumerable: true, get: function () { return get_global_1.getGlobal; } });
|
|
17
|
+
var read_dir_recursive_1 = require("./lib/utils/read-dir-recursive");
|
|
18
|
+
Object.defineProperty(exports, "readDirRecursive", { enumerable: true, get: function () { return read_dir_recursive_1.readDirRecursive; } });
|
|
19
|
+
Object.defineProperty(exports, "readDirRecursiveWithContents", { enumerable: true, get: function () { return read_dir_recursive_1.readDirRecursiveWithContents; } });
|
|
16
20
|
// errors
|
|
17
21
|
var errors_1 = require("./lib/errors");
|
|
18
22
|
Object.defineProperty(exports, "ZeErrors", { enumerable: true, get: function () { return errors_1.ZeErrors; } });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,mBAAmB;AACnB,qEAAuF;AAA9E,yHAAA,mBAAmB,OAAA;AAAE,sHAAA,gBAAgB,OAAA;AAC9C,sBAAsB;AACtB,4EAI+C;AAH7C,wHAAA,kBAAkB,OAAA;AAClB,2HAAA,qBAAqB,OAAA;AACrB,yHAAA,mBAAmB,OAAA;AAGrB,mBAAmB;AACnB,qDAAmD;AAA1C,uGAAA,SAAS,OAAA;AAClB,qEAIwC;AAHtC,sHAAA,gBAAgB,OAAA;AAChB,kIAAA,4BAA4B,OAAA;AAI9B,SAAS;AACT,uCAAqD;AAA5C,kGAAA,QAAQ,OAAA;AAAE,qGAAA,WAAW,OAAA;AAC9B,uCAAiD;AAAxC,2GAAA,iBAAiB,OAAA;AAE1B,gBAAgB;AAChB,sFAKoD;AAJlD,iIAAA,sBAAsB,OAAA;AACtB,6HAAA,kBAAkB,OAAA;AAClB,6HAAA,kBAAkB,OAAA;AAIpB,SAAS;AACT,yCAAuC;AAA9B,iGAAA,MAAM,OAAA;AACf,2DAAmD;AAA1C,qGAAA,KAAK,OAAA;AACd,yDAUmC;AATjC,+GAAA,gBAAgB,OAAA;AAChB,+GAAA,gBAAgB,OAAA;AAChB,0GAAA,WAAW,OAAA;AACX,6GAAA,cAAc,OAAA;AACd,8GAAA,eAAe,OAAA;AACf,mHAAA,oBAAoB,OAAA;AACpB,6GAAA,cAAc,OAAA;AACd,2GAAA,YAAY,OAAA;AAId,uBAAuB;AACvB,8EAGgD;AAF9C,4HAAA,qBAAqB,OAAA;AACrB,wHAAA,iBAAiB,OAAA;AAEnB,sEAAmE;AAA1D,gHAAA,aAAa,OAAA;AACtB,8EAGgD;AAF9C,qHAAA,kBAAkB,OAAkB;AAGtC,4EAAwE;AAA/D,qHAAA,eAAe,OAAA;AACxB,4EAK+C;AAJ7C,iIAAA,2BAA2B,OAAA;AAC3B,yHAAA,mBAAmB,OAAA;AACnB,2HAAA,qBAAqB,OAAA;AACrB,0HAAA,oBAAoB,OAAA;AAGtB,uBAAuB;AACvB,oDAAyF;AAAhF,gIAAA,kCAAkC,OAAA;AAAE,0GAAA,YAAY,OAAA;AAEzD,qDAAqD;AACrD,iDAOyB;AANvB,6GAAA,YAAY,OAAA;AACZ,0HAAA,yBAAyB,OAAA;AACzB,gHAAA,eAAe,OAAA;AAQjB,iCAAiC;AACjC,qDAgB6B;AAf3B,kHAAA,iBAAiB,OAAA;AACjB,wHAAA,uBAAuB,OAAA;AACvB,qHAAA,oBAAoB,OAAA;AACpB,+HAAA,8BAA8B,OAAA;AAE9B,kHAAA,iBAAiB,OAAA;AACjB,+GAAA,cAAc,OAAA;AACd,+GAAA,cAAc,OAAA;AACd,gHAAA,eAAe,OAAA;AACf,mHAAA,kBAAkB,OAAA;AAClB,sHAAA,qBAAqB,OAAA;AACrB,kHAAA,iBAAiB,OAAA;AACjB,wHAAA,uBAAuB,OAAA;AACvB,sHAAA,qBAAqB,OAAA;AACrB,oHAAA,mBAAmB,OAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface FileInfo {
|
|
2
|
+
/** Full absolute path to the file */
|
|
3
|
+
fullPath: string;
|
|
4
|
+
/** Relative path from the root directory */
|
|
5
|
+
relativePath: string;
|
|
6
|
+
/** Whether this is a directory */
|
|
7
|
+
isDirectory: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Reads a directory recursively and returns information about all files. Returns an empty
|
|
11
|
+
* array if the directory doesn't exist.
|
|
12
|
+
*
|
|
13
|
+
* @param dirPath - The absolute path to the directory to read
|
|
14
|
+
* @returns Array of file information objects
|
|
15
|
+
*/
|
|
16
|
+
export declare function readDirRecursive(dirPath: string): Promise<FileInfo[]>;
|
|
17
|
+
/**
|
|
18
|
+
* Reads a directory recursively and returns file contents along with metadata. Skips
|
|
19
|
+
* directories and only returns actual files with their contents. Returns an empty array
|
|
20
|
+
* if the directory doesn't exist.
|
|
21
|
+
*
|
|
22
|
+
* @param dirPath - The absolute path to the directory to read
|
|
23
|
+
* @returns Array of file information with contents
|
|
24
|
+
*/
|
|
25
|
+
export declare function readDirRecursiveWithContents(dirPath: string): Promise<Array<FileInfo & {
|
|
26
|
+
content: Buffer;
|
|
27
|
+
}>>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readDirRecursive = readDirRecursive;
|
|
4
|
+
exports.readDirRecursiveWithContents = readDirRecursiveWithContents;
|
|
5
|
+
const promises_1 = require("node:fs/promises");
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
|
+
/**
|
|
8
|
+
* Reads a directory recursively and returns information about all files. Returns an empty
|
|
9
|
+
* array if the directory doesn't exist.
|
|
10
|
+
*
|
|
11
|
+
* @param dirPath - The absolute path to the directory to read
|
|
12
|
+
* @returns Array of file information objects
|
|
13
|
+
*/
|
|
14
|
+
async function readDirRecursive(dirPath) {
|
|
15
|
+
try {
|
|
16
|
+
await (0, promises_1.stat)(dirPath);
|
|
17
|
+
}
|
|
18
|
+
catch (_a) {
|
|
19
|
+
return [];
|
|
20
|
+
}
|
|
21
|
+
const entries = await (0, promises_1.readdir)(dirPath, {
|
|
22
|
+
recursive: true,
|
|
23
|
+
withFileTypes: true,
|
|
24
|
+
});
|
|
25
|
+
return entries.map((entry) => {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
return ({
|
|
28
|
+
fullPath: (0, node_path_1.resolve)((_a = entry.parentPath) !== null && _a !== void 0 ? _a : entry.path, entry.name),
|
|
29
|
+
relativePath: (0, node_path_1.relative)(dirPath, (0, node_path_1.resolve)((_b = entry.parentPath) !== null && _b !== void 0 ? _b : entry.path, entry.name)),
|
|
30
|
+
isDirectory: entry.isDirectory(),
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Reads a directory recursively and returns file contents along with metadata. Skips
|
|
36
|
+
* directories and only returns actual files with their contents. Returns an empty array
|
|
37
|
+
* if the directory doesn't exist.
|
|
38
|
+
*
|
|
39
|
+
* @param dirPath - The absolute path to the directory to read
|
|
40
|
+
* @returns Array of file information with contents
|
|
41
|
+
*/
|
|
42
|
+
async function readDirRecursiveWithContents(dirPath) {
|
|
43
|
+
const files = await readDirRecursive(dirPath);
|
|
44
|
+
const fileContents = await Promise.all(files
|
|
45
|
+
.filter((file) => !file.isDirectory)
|
|
46
|
+
.map(async (file) => (Object.assign(Object.assign({}, file), { content: await (0, promises_1.readFile)(file.fullPath) }))));
|
|
47
|
+
return fileContents;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=read-dir-recursive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-dir-recursive.js","sourceRoot":"","sources":["../../../src/lib/utils/read-dir-recursive.ts"],"names":[],"mappings":";;AAmBA,4CAiBC;AAUD,oEAcC;AA5DD,+CAA2D;AAC3D,yCAA8C;AAW9C;;;;;;GAMG;AACI,KAAK,UAAU,gBAAgB,CAAC,OAAe;IACpD,IAAI,CAAC;QACH,MAAM,IAAA,eAAI,EAAC,OAAO,CAAC,CAAC;IACtB,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,IAAA,kBAAO,EAAC,OAAO,EAAE;QACrC,SAAS,EAAE,IAAI;QACf,aAAa,EAAE,IAAI;KACpB,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;;QAAC,OAAA,CAAC;YAC7B,QAAQ,EAAE,IAAA,mBAAO,EAAC,MAAA,KAAK,CAAC,UAAU,mCAAI,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC;YAC7D,YAAY,EAAE,IAAA,oBAAQ,EAAC,OAAO,EAAE,IAAA,mBAAO,EAAC,MAAA,KAAK,CAAC,UAAU,mCAAI,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;YACpF,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE;SACjC,CAAC,CAAA;KAAA,CAAC,CAAC;AACN,CAAC;AAED;;;;;;;GAOG;AACI,KAAK,UAAU,4BAA4B,CAChD,OAAe;IAEf,MAAM,KAAK,GAAG,MAAM,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC9C,MAAM,YAAY,GAAG,MAAM,OAAO,CAAC,GAAG,CACpC,KAAK;SACF,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC;SACnC,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,iCAChB,IAAI,KACP,OAAO,EAAE,MAAM,IAAA,mBAAQ,EAAC,IAAI,CAAC,QAAQ,CAAC,IACtC,CAAC,CACN,CAAC;IAEF,OAAO,YAAY,CAAC;AACtB,CAAC"}
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zephyr-agent",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6-next.1",
|
|
4
4
|
"description": "Zephyr plugin agent",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"open": "^10.1.0",
|
|
41
41
|
"proper-lockfile": "^4.1.2",
|
|
42
42
|
"tslib": "^2.8.1",
|
|
43
|
-
"zephyr-edge-contract": "0.1.
|
|
43
|
+
"zephyr-edge-contract": "0.1.6-next.1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@jest/globals": "^29.7.0",
|