@knockdata/objectexplorer 0.4.1 → 0.4.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/app/assets/WorkerParser.js +80 -80
- package/app/assets/browser-4.js +1 -1
- package/app/assets/browser.js +1 -1
- package/app/assets/index.css +1 -1
- package/app/assets/index.js +94 -91
- package/app/assets/search-worker.js +3 -3
- package/app/assets/wasm-worker.js +1 -1
- package/cli.js +3 -32
- package/package.json +2 -2
- package/server/WebServer.mjs +476 -263
- package/server/logging.proto +62 -0
package/cli.js
CHANGED
|
@@ -51,10 +51,6 @@ const startFolder = positional[0] ? path.resolve(positional[0]) : process.cwd()
|
|
|
51
51
|
const userData = path.join(os.homedir(), ".objectexplorer")
|
|
52
52
|
fs.mkdirSync(userData, { recursive: true })
|
|
53
53
|
|
|
54
|
-
// seed the launch folder as a default root; the server keeps existing folders.json
|
|
55
|
-
// entries whose folderPath still exists, so this just needs to be present on disk.
|
|
56
|
-
seedFolder(userData, startFolder)
|
|
57
|
-
|
|
58
54
|
// an absolute path is not a valid ESM specifier on Windows ("C:\..." parses as scheme
|
|
59
55
|
// "c:"), so the bundle is addressed as a file:// URL; the dev branch stays relative.
|
|
60
56
|
const serverPath = isDev ? "../server/WebServer.js" : pathToFileURL(path.join(bundleDir, "WebServer.mjs")).href
|
|
@@ -68,6 +64,9 @@ const server = await WebServer({
|
|
|
68
64
|
publicDir,
|
|
69
65
|
demoPath,
|
|
70
66
|
userData,
|
|
67
|
+
// the launch folder becomes a root, so it is in the tree on the first run; the server
|
|
68
|
+
// records it in meta.db and finds it there on the next start
|
|
69
|
+
startFolder,
|
|
71
70
|
port,
|
|
72
71
|
portRetry: true,
|
|
73
72
|
})
|
|
@@ -81,34 +80,6 @@ else {
|
|
|
81
80
|
openBrowser(url)
|
|
82
81
|
}
|
|
83
82
|
|
|
84
|
-
function seedFolder(userData, folderPath) {
|
|
85
|
-
const foldersFile = path.join(userData, "folders.json")
|
|
86
|
-
let folders = []
|
|
87
|
-
if (fs.existsSync(foldersFile)) {
|
|
88
|
-
folders = JSON.parse(fs.readFileSync(foldersFile, "utf8"))
|
|
89
|
-
}
|
|
90
|
-
const exists = folders.find(folder => folder.folderPath === folderPath)
|
|
91
|
-
if (exists) {
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
const name = folderName(folderPath)
|
|
95
|
-
folders.push({ name, root: name, path: "/", objectKind: "folder", folderPath })
|
|
96
|
-
fs.writeFileSync(foldersFile, JSON.stringify(folders, null, 4))
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// path.basename of a drive root ("C:\") or of "/" is empty, so fall back to the path
|
|
101
|
-
// with its separators and colon stripped ("C:\" -> "C", "/" -> "root")
|
|
102
|
-
function folderName(folderPath) {
|
|
103
|
-
const name = path.basename(folderPath)
|
|
104
|
-
if (name) {
|
|
105
|
-
return name
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
return folderPath.replace(/[\\/:]/g, "") || "root"
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
83
|
function openBrowser(target) {
|
|
113
84
|
if (process.platform === "darwin") {
|
|
114
85
|
launch("open", [target])
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knockdata/objectexplorer",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "The VSCode for Cloud Storage — Explore, Analyze, Search your cloud storage locally with single click",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "ISC",
|
|
@@ -35,4 +35,4 @@
|
|
|
35
35
|
"engines": {
|
|
36
36
|
"node": ">=20"
|
|
37
37
|
}
|
|
38
|
-
}
|
|
38
|
+
}
|