codex-lens 0.1.1 → 0.1.3
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/build.js +9 -16
- package/dist/pty-manager.js +182 -0
- package/dist/public/assets/main-B86_1Kr6.js +50 -0
- package/dist/public/assets/main-CPDV3aMv.css +32 -0
- package/dist/public/index.html +13 -0
- package/dist/snapshot-manager.js +208 -0
- package/package.json +1 -1
- package/vite.config.js +1 -1
- package/dist/main.css +0 -658
- package/dist/main.js +0 -31446
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2014 The xterm.js authors. All rights reserved.
|
|
3
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
4
|
+
* https://github.com/chjj/term.js
|
|
5
|
+
* @license MIT
|
|
6
|
+
*
|
|
7
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
* in the Software without restriction, including without limitation the rights
|
|
10
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
* furnished to do so, subject to the following conditions:
|
|
13
|
+
*
|
|
14
|
+
* The above copyright notice and this permission notice shall be included in
|
|
15
|
+
* all copies or substantial portions of the Software.
|
|
16
|
+
*
|
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
23
|
+
* THE SOFTWARE.
|
|
24
|
+
*
|
|
25
|
+
* Originally forked from (with the author's permission):
|
|
26
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
27
|
+
* http://bellard.org/jslinux/
|
|
28
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
29
|
+
* The original design remains. The terminal itself
|
|
30
|
+
* has been extended to include xterm CSI codes, among
|
|
31
|
+
* other features.
|
|
32
|
+
*/.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}:root{--bg-primary: #1e1e1e;--bg-secondary: #252526;--bg-tertiary: #2d2d30;--text-primary: #cccccc;--text-secondary: #858585;--border-color: #3c3c3c;--accent-color: #007acc;--accent-hover: #1e8ad2;--diff-add-bg: #2d4a2d;--diff-add-text: #89d185;--diff-remove-bg: #5a2d2d;--diff-remove-text: #f48771;--font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;--font-mono: "SF Mono", "Fira Code", "Consolas", monospace}*{margin:0;padding:0;box-sizing:border-box}html,body,#root{height:100%;width:100%;overflow:hidden}body{font-family:var(--font-family);background-color:var(--bg-primary);color:var(--text-primary);font-size:14px;line-height:1.5}.app-container{display:flex;height:100vh;width:100vw}.panel{display:flex;flex-direction:column;overflow:hidden;border-right:1px solid var(--border-color)}.panel:last-child{border-right:none}.panel-header{padding:8px 12px;background:var(--bg-tertiary);border-bottom:1px solid var(--border-color);font-weight:600;font-size:12px;text-transform:uppercase;color:var(--text-secondary)}.panel-content{flex:1;overflow:auto}.file-tree{padding:8px}.file-item{padding:4px 8px;cursor:pointer;border-radius:3px;display:flex;align-items:center;gap:6px}.file-item:hover{background:var(--bg-tertiary)}.file-item.active{background:var(--accent-color)}.file-icon{width:16px;height:16px}.diff-line{font-family:var(--font-mono);font-size:13px;padding:2px 12px;white-space:pre}.diff-line.added{background:var(--diff-add-bg);color:var(--diff-add-text)}.diff-line.removed{background:var(--diff-remove-bg);color:var(--diff-remove-text)}.diff-line:before{display:inline-block;width:16px;margin-right:8px;text-align:center;font-weight:700}.diff-line.added:before{content:"+"}.diff-line.removed:before{content:"-"}.chat-message{padding:8px 12px;margin:4px 8px;border-radius:8px;max-width:85%}.chat-message.user{background:var(--accent-color);color:#fff;margin-left:auto}.chat-message.codex{background:var(--bg-tertiary);color:var(--text-primary)}.chat-input-container{padding:12px;border-top:1px solid var(--border-color);background:var(--bg-secondary)}.chat-input{width:100%;padding:8px 12px;background:var(--bg-primary);border:1px solid var(--border-color);border-radius:4px;color:var(--text-primary);font-family:var(--font-family);resize:none}.chat-input:focus{outline:none;border-color:var(--accent-color)}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-track{background:var(--bg-secondary)}::-webkit-scrollbar-thumb{background:var(--border-color);border-radius:5px}::-webkit-scrollbar-thumb:hover{background:var(--text-secondary)}.ws-status{display:inline-block;width:8px;height:8px;border-radius:50%;margin-left:8px}.ws-status.connected{background:#0dbc79}.ws-status.disconnected{background:#cd3131}.version-info{display:flex;align-items:center;gap:8px;margin-left:auto}.version-number{font-size:11px;color:var(--text-secondary);font-weight:400}.update-badge{font-size:10px;padding:2px 6px;background:#d9534f;color:#fff;border-radius:3px;cursor:pointer}.update-badge:hover{background:#c9302c}.terminal-wrapper{flex:1;overflow:hidden;min-height:0}.left-panel{width:250px;flex-shrink:0}.middle-panel{flex:1;min-width:300px}.right-panel{width:40%;min-width:300px;max-width:60%}.section{margin-bottom:16px}.section-title{padding:8px 12px 4px;font-size:11px;font-weight:600;color:var(--text-secondary);text-transform:uppercase}.empty-state{padding:20px;text-align:center;color:var(--text-secondary);font-size:13px}.code-panel{font-family:var(--font-mono)}.code-content{padding:12px;white-space:pre-wrap;word-break:break-all}.diff-container{font-family:var(--font-mono);font-size:13px}.tab-bar{display:flex;background:var(--bg-secondary);border-bottom:1px solid var(--border-color);overflow-x:auto;min-height:36px}.tab{display:flex;align-items:center;gap:8px;padding:8px 12px;background:var(--bg-secondary);border-right:1px solid var(--border-color);cursor:pointer;min-width:100px;max-width:200px;font-size:13px;color:var(--text-secondary)}.tab:hover{background:var(--bg-tertiary)}.tab.active{background:var(--bg-primary);color:var(--text-primary);border-bottom:2px solid var(--accent-color)}.tab-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tab-close{background:none;border:none;color:var(--text-secondary);font-size:16px;cursor:pointer;padding:0 4px;border-radius:3px;line-height:1}.tab-close:hover{background:#ffffff1a;color:var(--text-primary)}.context-menu{position:fixed;background:var(--bg-tertiary);border:1px solid var(--border-color);border-radius:4px;padding:4px 0;min-width:150px;box-shadow:0 4px 12px #0000004d;z-index:1000}.context-menu-item{padding:8px 16px;cursor:pointer;font-size:13px;color:var(--text-primary)}.context-menu-item:hover{background:var(--accent-color)}.task-bar{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background:var(--bg-secondary);border-bottom:1px solid var(--border-color);min-height:44px}.task-status{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:500}.task-status.idle{color:var(--text-secondary)}.task-status.running{color:var(--accent-color)}.task-status:before{content:"";display:inline-block;width:8px;height:8px;border-radius:50%}.task-status.idle:before{background:var(--text-secondary)}.task-status.running:before{background:var(--accent-color);animation:pulse 1.5s infinite}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.task-buttons{display:flex;gap:8px}.task-btn{padding:6px 12px;border:none;border-radius:4px;font-size:12px;font-weight:500;cursor:pointer;transition:background .2s}.task-btn-start{background:var(--accent-color);color:#fff}.task-btn-start:hover{background:var(--accent-hover)}.task-btn-rollback{background:#d9534f;color:#fff}.task-btn-rollback:hover{background:#c9302c}.task-btn-complete{background:#5cb85c;color:#fff}.task-btn-complete:hover{background:#4cae4c}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:#0009;display:flex;align-items:center;justify-content:center;z-index:2000}.modal-content{background:var(--bg-secondary);border:1px solid var(--border-color);border-radius:8px;padding:20px;min-width:320px;max-width:400px;box-shadow:0 8px 32px #0006}.modal-title{font-size:16px;font-weight:600;margin-bottom:12px;color:var(--text-primary)}.modal-body{font-size:14px;color:var(--text-secondary);margin-bottom:20px;line-height:1.6}.modal-buttons{display:flex;justify-content:flex-end;gap:12px}.modal-btn{padding:8px 16px;border:none;border-radius:4px;font-size:13px;font-weight:500;cursor:pointer;transition:background .2s}.modal-btn-cancel{background:var(--bg-tertiary);color:var(--text-primary)}.modal-btn-cancel:hover{background:var(--border-color)}.modal-btn-danger{background:#d9534f;color:#fff}.modal-btn-danger:hover{background:#c9302c}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>Codex Viewer</title>
|
|
7
|
+
<script type="module" crossorigin src="./assets/main-B86_1Kr6.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="./assets/main-CPDV3aMv.css">
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<div id="root"></div>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { readFileSync, writeFileSync, statSync, readdirSync, mkdirSync, cpSync, rmSync, existsSync } from "fs";
|
|
3
|
+
import { join, relative, extname } from "path";
|
|
4
|
+
import { createLogger } from "./lib/logger.js";
|
|
5
|
+
const logger = createLogger("SnapshotManager");
|
|
6
|
+
const IGNORED_DIRS = [
|
|
7
|
+
"node_modules",
|
|
8
|
+
".git",
|
|
9
|
+
".svn",
|
|
10
|
+
".hg",
|
|
11
|
+
".idea",
|
|
12
|
+
".vscode",
|
|
13
|
+
"dist",
|
|
14
|
+
"build",
|
|
15
|
+
".cache",
|
|
16
|
+
"__pycache__",
|
|
17
|
+
".pytest_cache",
|
|
18
|
+
".next",
|
|
19
|
+
".nuxt",
|
|
20
|
+
".venv",
|
|
21
|
+
".env",
|
|
22
|
+
".DS_Store",
|
|
23
|
+
".codex-viewer"
|
|
24
|
+
];
|
|
25
|
+
const IGNORED_FILES = [
|
|
26
|
+
".DS_Store",
|
|
27
|
+
"Thumbs.db",
|
|
28
|
+
"desktop.ini"
|
|
29
|
+
];
|
|
30
|
+
const IGNORED_EXTENSIONS = [
|
|
31
|
+
".log",
|
|
32
|
+
".lock"
|
|
33
|
+
];
|
|
34
|
+
class SnapshotManager {
|
|
35
|
+
constructor(snapshotsDir = ".codex-viewer/snapshots") {
|
|
36
|
+
this.snapshotsDir = snapshotsDir;
|
|
37
|
+
}
|
|
38
|
+
async createSnapshot(projectRoot, taskId) {
|
|
39
|
+
const snapshotPath = join(this.snapshotsDir, taskId);
|
|
40
|
+
const metadataPath = join(snapshotPath, "snapshot.json");
|
|
41
|
+
logger.info(`Creating snapshot: ${taskId}`);
|
|
42
|
+
try {
|
|
43
|
+
if (!existsSync(this.snapshotsDir)) {
|
|
44
|
+
mkdirSync(this.snapshotsDir, { recursive: true });
|
|
45
|
+
}
|
|
46
|
+
if (existsSync(snapshotPath)) {
|
|
47
|
+
rmSync(snapshotPath, { recursive: true, force: true });
|
|
48
|
+
}
|
|
49
|
+
mkdirSync(snapshotPath, { recursive: true });
|
|
50
|
+
const files = this.scanProjectFiles(projectRoot);
|
|
51
|
+
const metadata = {
|
|
52
|
+
taskId,
|
|
53
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
54
|
+
projectRoot,
|
|
55
|
+
filesCount: files.length,
|
|
56
|
+
files: []
|
|
57
|
+
};
|
|
58
|
+
for (const file of files) {
|
|
59
|
+
const relativePath = relative(projectRoot, file);
|
|
60
|
+
const destPath = join(snapshotPath, relativePath);
|
|
61
|
+
const destDir = join(snapshotPath, relative(projectRoot, join(file, "..")));
|
|
62
|
+
if (!existsSync(destDir)) {
|
|
63
|
+
mkdirSync(destDir, { recursive: true });
|
|
64
|
+
}
|
|
65
|
+
try {
|
|
66
|
+
cpSync(file, destPath, { force: true });
|
|
67
|
+
const stats = statSync(file);
|
|
68
|
+
metadata.files.push({
|
|
69
|
+
path: relativePath,
|
|
70
|
+
size: stats.size,
|
|
71
|
+
mtime: stats.mtime.toISOString()
|
|
72
|
+
});
|
|
73
|
+
} catch (err) {
|
|
74
|
+
logger.warn(`Failed to copy file ${file}: ${err.message}`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
writeFileSync(metadataPath, JSON.stringify(metadata, null, 2));
|
|
78
|
+
logger.info(`Snapshot created: ${taskId}, ${files.length} files`);
|
|
79
|
+
return { success: true, snapshotPath, filesCount: files.length };
|
|
80
|
+
} catch (error) {
|
|
81
|
+
logger.error(`Failed to create snapshot: ${error.message}`);
|
|
82
|
+
return { success: false, error: error.message };
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async restoreSnapshot(taskId) {
|
|
86
|
+
const snapshotPath = join(this.snapshotsDir, taskId);
|
|
87
|
+
const metadataPath = join(snapshotPath, "snapshot.json");
|
|
88
|
+
logger.info(`Restoring snapshot: ${taskId}`);
|
|
89
|
+
try {
|
|
90
|
+
if (!existsSync(snapshotPath)) {
|
|
91
|
+
return { success: false, error: "Snapshot not found" };
|
|
92
|
+
}
|
|
93
|
+
if (!existsSync(metadataPath)) {
|
|
94
|
+
return { success: false, error: "Snapshot metadata not found" };
|
|
95
|
+
}
|
|
96
|
+
const metadata = JSON.parse(readFileSync(metadataPath, "utf-8"));
|
|
97
|
+
const projectRoot = metadata.projectRoot;
|
|
98
|
+
let restoredCount = 0;
|
|
99
|
+
for (const fileInfo of metadata.files) {
|
|
100
|
+
const sourcePath = join(snapshotPath, fileInfo.path);
|
|
101
|
+
const destPath = join(projectRoot, fileInfo.path);
|
|
102
|
+
if (!existsSync(sourcePath)) {
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
const destDir = join(projectRoot, fileInfo.path.replace(/[^/\\]+$/, ""));
|
|
106
|
+
if (!existsSync(destDir)) {
|
|
107
|
+
mkdirSync(destDir, { recursive: true });
|
|
108
|
+
}
|
|
109
|
+
try {
|
|
110
|
+
cpSync(sourcePath, destPath, { force: true });
|
|
111
|
+
restoredCount++;
|
|
112
|
+
} catch (err) {
|
|
113
|
+
logger.warn(`Failed to restore file ${fileInfo.path}: ${err.message}`);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
logger.info(`Snapshot restored: ${taskId}, ${restoredCount} files`);
|
|
117
|
+
return { success: true, restoredCount };
|
|
118
|
+
} catch (error) {
|
|
119
|
+
logger.error(`Failed to restore snapshot: ${error.message}`);
|
|
120
|
+
return { success: false, error: error.message };
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
async deleteSnapshot(taskId) {
|
|
124
|
+
const snapshotPath = join(this.snapshotsDir, taskId);
|
|
125
|
+
logger.info(`Deleting snapshot: ${taskId}`);
|
|
126
|
+
try {
|
|
127
|
+
if (existsSync(snapshotPath)) {
|
|
128
|
+
rmSync(snapshotPath, { recursive: true, force: true });
|
|
129
|
+
logger.info(`Snapshot deleted: ${taskId}`);
|
|
130
|
+
return { success: true };
|
|
131
|
+
}
|
|
132
|
+
return { success: false, error: "Snapshot not found" };
|
|
133
|
+
} catch (error) {
|
|
134
|
+
logger.error(`Failed to delete snapshot: ${error.message}`);
|
|
135
|
+
return { success: false, error: error.message };
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
getSnapshot(taskId) {
|
|
139
|
+
const snapshotPath = join(this.snapshotsDir, taskId);
|
|
140
|
+
const metadataPath = join(snapshotPath, "snapshot.json");
|
|
141
|
+
if (!existsSync(metadataPath)) {
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
try {
|
|
145
|
+
return JSON.parse(readFileSync(metadataPath, "utf-8"));
|
|
146
|
+
} catch {
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
listSnapshots() {
|
|
151
|
+
try {
|
|
152
|
+
if (!existsSync(this.snapshotsDir)) {
|
|
153
|
+
return [];
|
|
154
|
+
}
|
|
155
|
+
const entries = readdirSync(this.snapshotsDir, { withFileTypes: true });
|
|
156
|
+
const snapshots = [];
|
|
157
|
+
for (const entry of entries) {
|
|
158
|
+
if (entry.isDirectory()) {
|
|
159
|
+
const metadata = this.getSnapshot(entry.name);
|
|
160
|
+
if (metadata) {
|
|
161
|
+
snapshots.push(metadata);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return snapshots.sort(
|
|
166
|
+
(a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()
|
|
167
|
+
);
|
|
168
|
+
} catch (error) {
|
|
169
|
+
logger.error(`Failed to list snapshots: ${error.message}`);
|
|
170
|
+
return [];
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
scanProjectFiles(projectRoot) {
|
|
174
|
+
const files = [];
|
|
175
|
+
const scan = (dir) => {
|
|
176
|
+
try {
|
|
177
|
+
const entries = readdirSync(dir, { withFileTypes: true });
|
|
178
|
+
for (const entry of entries) {
|
|
179
|
+
const fullPath = join(dir, entry.name);
|
|
180
|
+
if (entry.isDirectory()) {
|
|
181
|
+
if (!IGNORED_DIRS.includes(entry.name) && !entry.name.startsWith(".")) {
|
|
182
|
+
scan(fullPath);
|
|
183
|
+
}
|
|
184
|
+
} else if (entry.isFile()) {
|
|
185
|
+
if (IGNORED_FILES.includes(entry.name)) {
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
if (IGNORED_EXTENSIONS.some((ext) => entry.name.endsWith(ext))) {
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
files.push(fullPath);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
} catch (err) {
|
|
195
|
+
logger.warn(`Failed to scan directory ${dir}: ${err.message}`);
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
scan(projectRoot);
|
|
199
|
+
return files;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
function createSnapshotManager(snapshotsDir) {
|
|
203
|
+
return new SnapshotManager(snapshotsDir);
|
|
204
|
+
}
|
|
205
|
+
export {
|
|
206
|
+
SnapshotManager,
|
|
207
|
+
createSnapshotManager
|
|
208
|
+
};
|
package/package.json
CHANGED