opencode-preview-plus 0.13.0 → 0.13.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/{chunk-ZHJFGWJ2.js → chunk-NQ3FC3FR.js} +18 -3
- package/dist/index.js +1 -1
- package/dist/server.js +1 -1
- package/dist/tui.js +18 -3
- package/package.json +1 -1
|
@@ -2844,7 +2844,12 @@ function clearExternalPreviewFilesForTest() {
|
|
|
2844
2844
|
}
|
|
2845
2845
|
var IGNORED_DIRS = /* @__PURE__ */ new Set(["node_modules", ".git", "dist", ".next", "__pycache__", ".venv", "venv"]);
|
|
2846
2846
|
async function collectPreviewFiles(directory, base = directory) {
|
|
2847
|
-
|
|
2847
|
+
let entries;
|
|
2848
|
+
try {
|
|
2849
|
+
entries = await readdir(directory, { withFileTypes: true });
|
|
2850
|
+
} catch {
|
|
2851
|
+
return [];
|
|
2852
|
+
}
|
|
2848
2853
|
const files = await Promise.all(
|
|
2849
2854
|
entries.map(async (entry) => {
|
|
2850
2855
|
const absolutePath = path2.join(directory, entry.name);
|
|
@@ -2863,12 +2868,22 @@ async function collectPreviewFiles(directory, base = directory) {
|
|
|
2863
2868
|
return files.flat().sort((a, b) => a.localeCompare(b));
|
|
2864
2869
|
}
|
|
2865
2870
|
async function collectEmptyDirectories(directory, base = directory) {
|
|
2866
|
-
|
|
2871
|
+
let entries;
|
|
2872
|
+
try {
|
|
2873
|
+
entries = await readdir(directory, { withFileTypes: true });
|
|
2874
|
+
} catch {
|
|
2875
|
+
return [];
|
|
2876
|
+
}
|
|
2867
2877
|
const childDirectories = entries.filter((entry) => entry.isDirectory() && !IGNORED_DIRS.has(entry.name));
|
|
2868
2878
|
const nested = await Promise.all(
|
|
2869
2879
|
childDirectories.map(async (entry) => {
|
|
2870
2880
|
const absolutePath = path2.join(directory, entry.name);
|
|
2871
|
-
|
|
2881
|
+
let childEntries;
|
|
2882
|
+
try {
|
|
2883
|
+
childEntries = await readdir(absolutePath, { withFileTypes: true });
|
|
2884
|
+
} catch {
|
|
2885
|
+
return [];
|
|
2886
|
+
}
|
|
2872
2887
|
const childResults = await collectEmptyDirectories(absolutePath, base);
|
|
2873
2888
|
if (childEntries.length === 0) {
|
|
2874
2889
|
return [path2.relative(base, absolutePath).split(path2.sep).join("/"), ...childResults];
|
package/dist/index.js
CHANGED
package/dist/server.js
CHANGED
package/dist/tui.js
CHANGED
|
@@ -2827,7 +2827,12 @@ function resolveExternalPreviewFile(token) {
|
|
|
2827
2827
|
}
|
|
2828
2828
|
var IGNORED_DIRS = /* @__PURE__ */ new Set(["node_modules", ".git", "dist", ".next", "__pycache__", ".venv", "venv"]);
|
|
2829
2829
|
async function collectPreviewFiles(directory, base = directory) {
|
|
2830
|
-
|
|
2830
|
+
let entries;
|
|
2831
|
+
try {
|
|
2832
|
+
entries = await readdir(directory, { withFileTypes: true });
|
|
2833
|
+
} catch {
|
|
2834
|
+
return [];
|
|
2835
|
+
}
|
|
2831
2836
|
const files = await Promise.all(
|
|
2832
2837
|
entries.map(async (entry) => {
|
|
2833
2838
|
const absolutePath = path2.join(directory, entry.name);
|
|
@@ -2846,12 +2851,22 @@ async function collectPreviewFiles(directory, base = directory) {
|
|
|
2846
2851
|
return files.flat().sort((a, b) => a.localeCompare(b));
|
|
2847
2852
|
}
|
|
2848
2853
|
async function collectEmptyDirectories(directory, base = directory) {
|
|
2849
|
-
|
|
2854
|
+
let entries;
|
|
2855
|
+
try {
|
|
2856
|
+
entries = await readdir(directory, { withFileTypes: true });
|
|
2857
|
+
} catch {
|
|
2858
|
+
return [];
|
|
2859
|
+
}
|
|
2850
2860
|
const childDirectories = entries.filter((entry) => entry.isDirectory() && !IGNORED_DIRS.has(entry.name));
|
|
2851
2861
|
const nested = await Promise.all(
|
|
2852
2862
|
childDirectories.map(async (entry) => {
|
|
2853
2863
|
const absolutePath = path2.join(directory, entry.name);
|
|
2854
|
-
|
|
2864
|
+
let childEntries;
|
|
2865
|
+
try {
|
|
2866
|
+
childEntries = await readdir(absolutePath, { withFileTypes: true });
|
|
2867
|
+
} catch {
|
|
2868
|
+
return [];
|
|
2869
|
+
}
|
|
2855
2870
|
const childResults = await collectEmptyDirectories(absolutePath, base);
|
|
2856
2871
|
if (childEntries.length === 0) {
|
|
2857
2872
|
return [path2.relative(base, absolutePath).split(path2.sep).join("/"), ...childResults];
|