Fix: 修复Python Online板卡下「本地文件系统」连续多次读取目录时报错

This commit is contained in:
王立帮
2024-11-27 14:22:02 +08:00
parent e0534d607d
commit 624012e96f
7 changed files with 542 additions and 90 deletions

View File

@@ -1,5 +1,5 @@
import * as path from 'path';
import { FileTree } from 'mixly';
import { FileTree, Debug } from 'mixly';
import FileSystemFS from './filesystem-fs';
@@ -9,36 +9,36 @@ export default class FileSystemFileTree extends FileTree {
}
async readFolder(inPath) {
const fs = this.getFS();
const [, status] = await fs.isDirectory(inPath);
let output = [];
if (!status) {
return output;
}
const result = await fs.readDirectory(inPath);
let children = [];
if (result.length == 2) {
children = result[1];
}
for (let data of children) {
const dataPath = path.join(inPath, data);
const [, isDirectory] = await fs.isDirectory(dataPath);
if (isDirectory) {
const [, isDirEmpty] = await fs.isDirectoryEmpty(dataPath);
output.push({
type: 'folder',
id: dataPath,
children: !isDirEmpty,
title: `/${this.getRootFolderName()}${dataPath}`
});
} else {
output.push({
type: 'file',
id: dataPath,
children: false,
title: `/${this.getRootFolderName()}${dataPath}`
});
try {
const fs = this.getFS();
const status = await fs.isDirectory(inPath);
if (!status) {
return output;
}
const children = await fs.readDirectory(inPath);
for (let data of children) {
const dataPath = path.join(inPath, data);
const isDirectory = await fs.isDirectory(dataPath);
if (isDirectory) {
const isDirEmpty = await fs.isDirectoryEmpty(dataPath);
output.push({
type: 'folder',
id: dataPath,
children: !isDirEmpty,
title: `/${this.getRootFolderName()}${dataPath}`
});
} else {
output.push({
type: 'file',
id: dataPath,
children: false,
title: `/${this.getRootFolderName()}${dataPath}`
});
}
}
} catch (error) {
Debug.error(error);
}
return output;
}

View File

@@ -1,16 +1,27 @@
import { WebAccessFS } from '@zenfs/dom';
import { FS } from 'mixly';
export default class FileSystemFS extends FS {
static {
this.pool = window.workerpool.pool('../common/modules/mixly-modules/workers/web/file-system-access.js', {
workerOpts: {
name: 'pyodideFileSystemAccess'
},
workerType: 'web'
});
class WebAccessFSExt extends WebAccessFS {
constructor(handle) {
super(handle);
}
async readFile(path) {
const handle = await this.getHandle(path);
if (handle instanceof window.FileSystemFileHandle) {
const file = await handle.getFile();
const text = await file.text();
return text;
}
return '';
}
}
export default class FileSystemFS extends FS {
#fs_ = null;
constructor() {
super();
}
@@ -21,32 +32,32 @@ export default class FileSystemFS extends FS {
if (permissionStatus !== 'granted') {
throw new Error('readwrite access to directory not granted');
}
await FileSystemFS.pool.exec('addFileSystemHandler', [directoryHandle]);
this.#fs_ = new WebAccessFSExt(directoryHandle);
return directoryHandle;
}
async createFile(filePath) {
return this.writeFile(filePath, '');
return this.#fs_.createFile(filePath, '');
}
async readFile(path) {
return FileSystemFS.pool.exec('readFile', [path, 'utf8']);
return this.#fs_.readFile(path);
}
async writeFile(path, data) {
return FileSystemFS.pool.exec('writeFile', [path, data, 'utf8']);
return this.#fs_.writeFile(path, data, 'utf8');
}
async isFile(path) {
const [error, stats] = await FileSystemFS.pool.exec('stat', [path]);
if (stats && stats.mode === 33188) {
return [error, true];
const stats = await this.#fs_.stat(path);
if (stats && stats.mode === 33279) {
return true;
}
return [error, false];
return false;
}
async renameFile(oldFilePath, newFilePath) {
return await FileSystemFS.pool.exec('rename', [oldFilePath, newFilePath]);
return await this.#fs_.rename(oldFilePath, newFilePath);
}
async moveFile(oldFilePath, newFilePath) {
@@ -54,43 +65,40 @@ export default class FileSystemFS extends FS {
}
async deleteFile(filePath) {
return FileSystemFS.pool.exec('unlink', [filePath]);
return this.#fs_.unlink(filePath);
}
async createDirectory(folderPath) {
return FileSystemFS.pool.exec('mkdir', [folderPath, 0o777]);
return this.#fs_.mkdir(folderPath, 0o777);
}
async readDirectory(path) {
const result = await FileSystemFS.pool.exec('readdir', [path]);
if (result[0]) {
return [result[0], null];
}
const result = await this.#fs_.readdir(path);
return result;
}
async isDirectory(path) {
const [error, stats] = await FileSystemFS.pool.exec('stat', [path]);
if (stats && stats.mode === 33188) {
return [error, false];
const stats = await this.#fs_.stat(path);
if (stats && stats.mode === 16895) {
return true;
}
return [error, true];
return false;
}
async isDirectoryEmpty(path) {
const [error, result = []] = await this.readDirectory(path);
return [error, !result?.length];
const result = await this.readDirectory(path);
return !result?.length;
}
async renameDirectory(oldFolderPath, newFolderPath) {
return await FileSystemFS.pool.exec('rename', [oldFolderPath, newFolderPath]);
return this.#fs_.rename(oldFolderPath, newFolderPath);
}
async moveDirectory(oldFolderPath, newFolderPath) {
return FileSystemFS.pool.exec('rename', [oldFolderPath, newFolderPath]);
return this.#fs_.rename(oldFolderPath, newFolderPath);
}
async deleteDirectory(folderPath) {
return FileSystemFS.pool.exec('rmdir', [folderPath]);
return this.#fs_.rmdir(folderPath);
}
}

View File

@@ -108,16 +108,17 @@ export default class StatusBarFileSystem extends PageBase {
const filePath = selected[0].id;
this.#fileTree_.showProgress();
const fs = this.#fileTree_.getFS();
const [error, result] = await fs.readFile(filePath);
if (error) {
this.hideEditor();
this.#fileTree_.deselectAll();
} else {
try {
const result = await fs.readFile(filePath);
this.showEditor();
this.#editor_.setValue(result);
this.#editor_.scrollToTop();
this.#editor_.focus();
this.setStatus(false);
} catch (error) {
Debug.error(error);
this.hideEditor();
this.#fileTree_.deselectAll();
}
this.#fileTree_.hideProgress();
});

View File

@@ -10,6 +10,8 @@
"license": "Apache 2.0",
"dependencies": {
"@basthon/kernel-loader": "^0.62.21",
"@zenfs/core": "^1.4.0",
"@zenfs/dom": "^1.0.6",
"idb-keyval": "^6.2.1"
},
"devDependencies": {
@@ -99,6 +101,20 @@
"undici-types": "~6.19.2"
}
},
"node_modules/@types/readable-stream": {
"version": "4.0.18",
"resolved": "https://registry.npmmirror.com/@types/readable-stream/-/readable-stream-4.0.18.tgz",
"integrity": "sha512-21jK/1j+Wg+7jVw1xnSwy/2Q1VgVjWuFssbYGTREPUBeZ+rqVFl2udq0IkxzPC0ZhOzVceUbyIACFZKLqKEBlA==",
"dependencies": {
"@types/node": "*",
"safe-buffer": "~5.1.1"
}
},
"node_modules/@types/readable-stream/node_modules/safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
},
"node_modules/@types/sql.js": {
"version": "1.4.4",
"resolved": "https://registry.npmmirror.com/@types/sql.js/-/sql.js-1.4.4.tgz",
@@ -108,6 +124,106 @@
"@types/node": "*"
}
},
"node_modules/@types/wicg-file-system-access": {
"version": "2020.9.8",
"resolved": "https://registry.npmmirror.com/@types/wicg-file-system-access/-/wicg-file-system-access-2020.9.8.tgz",
"integrity": "sha512-ggMz8nOygG7d/stpH40WVaNvBwuyYLnrg5Mbyf6bmsj/8+gb6Ei4ZZ9/4PNpcPNTT8th9Q8sM8wYmWGjMWLX/A==",
"optional": true
},
"node_modules/@xterm/xterm": {
"version": "5.5.0",
"resolved": "https://registry.npmmirror.com/@xterm/xterm/-/xterm-5.5.0.tgz",
"integrity": "sha512-hqJHYaQb5OptNunnyAnkHyM8aCjZ1MEIDTQu1iIbbTD/xops91NB5yq1ZK/dC2JDbVWtF23zUtl9JE2NqwT87A==",
"optional": true
},
"node_modules/@zenfs/core": {
"version": "1.4.0",
"resolved": "https://registry.npmmirror.com/@zenfs/core/-/core-1.4.0.tgz",
"integrity": "sha512-8nYKm81H/m2VB+/tDkUfhUgTbVixlcPMLrno/6K0sWDlQqKOtt7/31aD+paqBl1SNa+d0Ky5RTNtTo7fU6t/9Q==",
"dependencies": {
"@types/node": "^20.16.10",
"@types/readable-stream": "^4.0.10",
"buffer": "^6.0.3",
"eventemitter3": "^5.0.1",
"readable-stream": "^4.5.2",
"utilium": "^1.0.0"
},
"bin": {
"make-index": "scripts/make-index.js",
"zenfs-test": "scripts/test.js"
},
"engines": {
"node": ">= 16"
},
"funding": {
"type": "individual",
"url": "https://github.com/sponsors/james-pre"
},
"optionalDependencies": {
"minimatch": "^9.0.3"
}
},
"node_modules/@zenfs/core/node_modules/@types/node": {
"version": "20.17.8",
"resolved": "https://registry.npmmirror.com/@types/node/-/node-20.17.8.tgz",
"integrity": "sha512-ahz2g6/oqbKalW9sPv6L2iRbhLnojxjYWspAqhjvqSWBgGebEJT5GvRmk0QXPj3sbC6rU0GTQjPLQkmR8CObvA==",
"dependencies": {
"undici-types": "~6.19.2"
}
},
"node_modules/@zenfs/core/node_modules/readable-stream": {
"version": "4.5.2",
"resolved": "https://registry.npmmirror.com/readable-stream/-/readable-stream-4.5.2.tgz",
"integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==",
"dependencies": {
"abort-controller": "^3.0.0",
"buffer": "^6.0.3",
"events": "^3.3.0",
"process": "^0.11.10",
"string_decoder": "^1.3.0"
},
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
}
},
"node_modules/@zenfs/core/node_modules/string_decoder": {
"version": "1.3.0",
"resolved": "https://registry.npmmirror.com/string_decoder/-/string_decoder-1.3.0.tgz",
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
"dependencies": {
"safe-buffer": "~5.2.0"
}
},
"node_modules/@zenfs/dom": {
"version": "1.0.6",
"resolved": "https://registry.npmmirror.com/@zenfs/dom/-/dom-1.0.6.tgz",
"integrity": "sha512-x1m5DVgxF2MLPKihsAvdslsr8plg0PDgtfq3ypjHoQul3oNOoSOQuhLbK6vJSu9WsaLNS2ZGQJz2S7m+KKICnA==",
"engines": {
"node": ">= 18"
},
"funding": {
"type": "individual",
"url": "https://github.com/sponsors/james-pre"
},
"optionalDependencies": {
"fake-indexeddb": "^6.0.0",
"file-system-access": "^1.0.4"
},
"peerDependencies": {
"@zenfs/core": "^1.3.0"
}
},
"node_modules/abort-controller": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/abort-controller/-/abort-controller-3.0.0.tgz",
"integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
"dependencies": {
"event-target-shim": "^5.0.0"
},
"engines": {
"node": ">=6.5"
}
},
"node_modules/asn1.js": {
"version": "4.10.1",
"resolved": "https://registry.npmmirror.com/asn1.js/-/asn1.js-4.10.1.tgz",
@@ -125,11 +241,16 @@
"integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==",
"dev": true
},
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
"optional": true
},
"node_modules/base64-js": {
"version": "1.5.1",
"resolved": "https://registry.npmmirror.com/base64-js/-/base64-js-1.5.1.tgz",
"integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
"dev": true,
"funding": [
{
"type": "github",
@@ -151,6 +272,15 @@
"integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==",
"dev": true
},
"node_modules/brace-expansion": {
"version": "2.0.1",
"resolved": "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-2.0.1.tgz",
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
"optional": true,
"dependencies": {
"balanced-match": "^1.0.0"
}
},
"node_modules/brorand": {
"version": "1.1.0",
"resolved": "https://registry.npmmirror.com/brorand/-/brorand-1.1.0.tgz",
@@ -229,7 +359,6 @@
"version": "6.0.3",
"resolved": "https://registry.npmmirror.com/buffer/-/buffer-6.0.3.tgz",
"integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
"dev": true,
"funding": [
{
"type": "github",
@@ -389,6 +518,27 @@
"integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==",
"dev": true
},
"node_modules/event-target-shim": {
"version": "5.0.1",
"resolved": "https://registry.npmmirror.com/event-target-shim/-/event-target-shim-5.0.1.tgz",
"integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==",
"engines": {
"node": ">=6"
}
},
"node_modules/eventemitter3": {
"version": "5.0.1",
"resolved": "https://registry.npmmirror.com/eventemitter3/-/eventemitter3-5.0.1.tgz",
"integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA=="
},
"node_modules/events": {
"version": "3.3.0",
"resolved": "https://registry.npmmirror.com/events/-/events-3.3.0.tgz",
"integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==",
"engines": {
"node": ">=0.8.x"
}
},
"node_modules/evp_bytestokey": {
"version": "1.0.3",
"resolved": "https://registry.npmmirror.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz",
@@ -399,6 +549,55 @@
"safe-buffer": "^5.1.1"
}
},
"node_modules/fake-indexeddb": {
"version": "6.0.0",
"resolved": "https://registry.npmmirror.com/fake-indexeddb/-/fake-indexeddb-6.0.0.tgz",
"integrity": "sha512-YEboHE5VfopUclOck7LncgIqskAqnv4q0EWbYCaxKKjAvO93c+TJIaBuGy8CBFdbg9nKdpN3AuPRwVBJ4k7NrQ==",
"optional": true,
"engines": {
"node": ">=18"
}
},
"node_modules/fetch-blob": {
"version": "3.2.0",
"resolved": "https://registry.npmmirror.com/fetch-blob/-/fetch-blob-3.2.0.tgz",
"integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/jimmywarting"
},
{
"type": "paypal",
"url": "https://paypal.me/jimmywarting"
}
],
"optional": true,
"dependencies": {
"node-domexception": "^1.0.0",
"web-streams-polyfill": "^3.0.3"
},
"engines": {
"node": "^12.20 || >= 14.13"
}
},
"node_modules/file-system-access": {
"version": "1.0.4",
"resolved": "https://registry.npmmirror.com/file-system-access/-/file-system-access-1.0.4.tgz",
"integrity": "sha512-JDlhH+gJfZu/oExmtN4/6VX+q1etlrbJbR5uzoBa4BzfTRQbEXGFuGIBRk3ZcPocko3WdEclZSu+d/SByjG6Rg==",
"optional": true,
"dependencies": {
"@types/wicg-file-system-access": "^2020.9.2",
"fetch-blob": "^3.0.0",
"node-domexception": "^1.0.0"
},
"engines": {
"node": ">=14"
},
"optionalDependencies": {
"web-streams-polyfill": "^3.1.0"
}
},
"node_modules/hash-base": {
"version": "3.0.4",
"resolved": "https://registry.npmmirror.com/hash-base/-/hash-base-3.0.4.tgz",
@@ -442,7 +641,6 @@
"version": "1.2.1",
"resolved": "https://registry.npmmirror.com/ieee754/-/ieee754-1.2.1.tgz",
"integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
"dev": true,
"funding": [
{
"type": "github",
@@ -512,6 +710,40 @@
"integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==",
"dev": true
},
"node_modules/minimatch": {
"version": "9.0.5",
"resolved": "https://registry.npmmirror.com/minimatch/-/minimatch-9.0.5.tgz",
"integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",
"optional": true,
"dependencies": {
"brace-expansion": "^2.0.1"
},
"engines": {
"node": ">=16 || 14 >=14.17"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/node-domexception": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/node-domexception/-/node-domexception-1.0.0.tgz",
"integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/jimmywarting"
},
{
"type": "github",
"url": "https://paypal.me/jimmywarting"
}
],
"optional": true,
"engines": {
"node": ">=10.5.0"
}
},
"node_modules/parse-asn1": {
"version": "5.1.7",
"resolved": "https://registry.npmmirror.com/parse-asn1/-/parse-asn1-5.1.7.tgz",
@@ -551,6 +783,14 @@
"node": ">=0.12"
}
},
"node_modules/process": {
"version": "0.11.10",
"resolved": "https://registry.npmmirror.com/process/-/process-0.11.10.tgz",
"integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==",
"engines": {
"node": ">= 0.6.0"
}
},
"node_modules/process-nextick-args": {
"version": "2.0.1",
"resolved": "https://registry.npmmirror.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
@@ -636,7 +876,6 @@
"version": "5.2.1",
"resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.2.1.tgz",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
"dev": true,
"funding": [
{
"type": "github",
@@ -725,11 +964,35 @@
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
"dev": true
},
"node_modules/utilium": {
"version": "1.1.0",
"resolved": "https://registry.npmmirror.com/utilium/-/utilium-1.1.0.tgz",
"integrity": "sha512-02uMD58LHEacpSkzx46JZ0FDvFGpSGUYN6mSHY9wqNUi4sZVNzDdUXa9unLLCj5pRxK28HcYqqe/iQToBpmxTw==",
"dependencies": {
"eventemitter3": "^5.0.1"
},
"funding": {
"type": "individual",
"url": "https://github.com/sponsors/james-pre"
},
"optionalDependencies": {
"@xterm/xterm": "^5.5.0"
}
},
"node_modules/vm-browserify": {
"version": "1.1.2",
"resolved": "https://registry.npmmirror.com/vm-browserify/-/vm-browserify-1.1.2.tgz",
"integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==",
"dev": true
},
"node_modules/web-streams-polyfill": {
"version": "3.3.3",
"resolved": "https://registry.npmmirror.com/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz",
"integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==",
"optional": true,
"engines": {
"node": ">= 8"
}
}
},
"dependencies": {
@@ -812,6 +1075,22 @@
"undici-types": "~6.19.2"
}
},
"@types/readable-stream": {
"version": "4.0.18",
"resolved": "https://registry.npmmirror.com/@types/readable-stream/-/readable-stream-4.0.18.tgz",
"integrity": "sha512-21jK/1j+Wg+7jVw1xnSwy/2Q1VgVjWuFssbYGTREPUBeZ+rqVFl2udq0IkxzPC0ZhOzVceUbyIACFZKLqKEBlA==",
"requires": {
"@types/node": "*",
"safe-buffer": "~5.1.1"
},
"dependencies": {
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
}
}
},
"@types/sql.js": {
"version": "1.4.4",
"resolved": "https://registry.npmmirror.com/@types/sql.js/-/sql.js-1.4.4.tgz",
@@ -821,6 +1100,79 @@
"@types/node": "*"
}
},
"@types/wicg-file-system-access": {
"version": "2020.9.8",
"resolved": "https://registry.npmmirror.com/@types/wicg-file-system-access/-/wicg-file-system-access-2020.9.8.tgz",
"integrity": "sha512-ggMz8nOygG7d/stpH40WVaNvBwuyYLnrg5Mbyf6bmsj/8+gb6Ei4ZZ9/4PNpcPNTT8th9Q8sM8wYmWGjMWLX/A==",
"optional": true
},
"@xterm/xterm": {
"version": "5.5.0",
"resolved": "https://registry.npmmirror.com/@xterm/xterm/-/xterm-5.5.0.tgz",
"integrity": "sha512-hqJHYaQb5OptNunnyAnkHyM8aCjZ1MEIDTQu1iIbbTD/xops91NB5yq1ZK/dC2JDbVWtF23zUtl9JE2NqwT87A==",
"optional": true
},
"@zenfs/core": {
"version": "1.4.0",
"resolved": "https://registry.npmmirror.com/@zenfs/core/-/core-1.4.0.tgz",
"integrity": "sha512-8nYKm81H/m2VB+/tDkUfhUgTbVixlcPMLrno/6K0sWDlQqKOtt7/31aD+paqBl1SNa+d0Ky5RTNtTo7fU6t/9Q==",
"requires": {
"@types/node": "^20.16.10",
"@types/readable-stream": "^4.0.10",
"buffer": "^6.0.3",
"eventemitter3": "^5.0.1",
"minimatch": "^9.0.3",
"readable-stream": "^4.5.2",
"utilium": "^1.0.0"
},
"dependencies": {
"@types/node": {
"version": "20.17.8",
"resolved": "https://registry.npmmirror.com/@types/node/-/node-20.17.8.tgz",
"integrity": "sha512-ahz2g6/oqbKalW9sPv6L2iRbhLnojxjYWspAqhjvqSWBgGebEJT5GvRmk0QXPj3sbC6rU0GTQjPLQkmR8CObvA==",
"requires": {
"undici-types": "~6.19.2"
}
},
"readable-stream": {
"version": "4.5.2",
"resolved": "https://registry.npmmirror.com/readable-stream/-/readable-stream-4.5.2.tgz",
"integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==",
"requires": {
"abort-controller": "^3.0.0",
"buffer": "^6.0.3",
"events": "^3.3.0",
"process": "^0.11.10",
"string_decoder": "^1.3.0"
}
},
"string_decoder": {
"version": "1.3.0",
"resolved": "https://registry.npmmirror.com/string_decoder/-/string_decoder-1.3.0.tgz",
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
"requires": {
"safe-buffer": "~5.2.0"
}
}
}
},
"@zenfs/dom": {
"version": "1.0.6",
"resolved": "https://registry.npmmirror.com/@zenfs/dom/-/dom-1.0.6.tgz",
"integrity": "sha512-x1m5DVgxF2MLPKihsAvdslsr8plg0PDgtfq3ypjHoQul3oNOoSOQuhLbK6vJSu9WsaLNS2ZGQJz2S7m+KKICnA==",
"requires": {
"fake-indexeddb": "^6.0.0",
"file-system-access": "^1.0.4"
}
},
"abort-controller": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/abort-controller/-/abort-controller-3.0.0.tgz",
"integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
"requires": {
"event-target-shim": "^5.0.0"
}
},
"asn1.js": {
"version": "4.10.1",
"resolved": "https://registry.npmmirror.com/asn1.js/-/asn1.js-4.10.1.tgz",
@@ -840,11 +1192,16 @@
}
}
},
"balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
"optional": true
},
"base64-js": {
"version": "1.5.1",
"resolved": "https://registry.npmmirror.com/base64-js/-/base64-js-1.5.1.tgz",
"integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
"dev": true
"integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="
},
"bn.js": {
"version": "5.2.1",
@@ -852,6 +1209,15 @@
"integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==",
"dev": true
},
"brace-expansion": {
"version": "2.0.1",
"resolved": "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-2.0.1.tgz",
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
"optional": true,
"requires": {
"balanced-match": "^1.0.0"
}
},
"brorand": {
"version": "1.1.0",
"resolved": "https://registry.npmmirror.com/brorand/-/brorand-1.1.0.tgz",
@@ -927,7 +1293,6 @@
"version": "6.0.3",
"resolved": "https://registry.npmmirror.com/buffer/-/buffer-6.0.3.tgz",
"integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
"dev": true,
"requires": {
"base64-js": "^1.3.1",
"ieee754": "^1.2.1"
@@ -1076,6 +1441,21 @@
}
}
},
"event-target-shim": {
"version": "5.0.1",
"resolved": "https://registry.npmmirror.com/event-target-shim/-/event-target-shim-5.0.1.tgz",
"integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ=="
},
"eventemitter3": {
"version": "5.0.1",
"resolved": "https://registry.npmmirror.com/eventemitter3/-/eventemitter3-5.0.1.tgz",
"integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA=="
},
"events": {
"version": "3.3.0",
"resolved": "https://registry.npmmirror.com/events/-/events-3.3.0.tgz",
"integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q=="
},
"evp_bytestokey": {
"version": "1.0.3",
"resolved": "https://registry.npmmirror.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz",
@@ -1086,6 +1466,34 @@
"safe-buffer": "^5.1.1"
}
},
"fake-indexeddb": {
"version": "6.0.0",
"resolved": "https://registry.npmmirror.com/fake-indexeddb/-/fake-indexeddb-6.0.0.tgz",
"integrity": "sha512-YEboHE5VfopUclOck7LncgIqskAqnv4q0EWbYCaxKKjAvO93c+TJIaBuGy8CBFdbg9nKdpN3AuPRwVBJ4k7NrQ==",
"optional": true
},
"fetch-blob": {
"version": "3.2.0",
"resolved": "https://registry.npmmirror.com/fetch-blob/-/fetch-blob-3.2.0.tgz",
"integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==",
"optional": true,
"requires": {
"node-domexception": "^1.0.0",
"web-streams-polyfill": "^3.0.3"
}
},
"file-system-access": {
"version": "1.0.4",
"resolved": "https://registry.npmmirror.com/file-system-access/-/file-system-access-1.0.4.tgz",
"integrity": "sha512-JDlhH+gJfZu/oExmtN4/6VX+q1etlrbJbR5uzoBa4BzfTRQbEXGFuGIBRk3ZcPocko3WdEclZSu+d/SByjG6Rg==",
"optional": true,
"requires": {
"@types/wicg-file-system-access": "^2020.9.2",
"fetch-blob": "^3.0.0",
"node-domexception": "^1.0.0",
"web-streams-polyfill": "^3.1.0"
}
},
"hash-base": {
"version": "3.0.4",
"resolved": "https://registry.npmmirror.com/hash-base/-/hash-base-3.0.4.tgz",
@@ -1125,8 +1533,7 @@
"ieee754": {
"version": "1.2.1",
"resolved": "https://registry.npmmirror.com/ieee754/-/ieee754-1.2.1.tgz",
"integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
"dev": true
"integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="
},
"inherits": {
"version": "2.0.4",
@@ -1181,6 +1588,21 @@
"integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==",
"dev": true
},
"minimatch": {
"version": "9.0.5",
"resolved": "https://registry.npmmirror.com/minimatch/-/minimatch-9.0.5.tgz",
"integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",
"optional": true,
"requires": {
"brace-expansion": "^2.0.1"
}
},
"node-domexception": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/node-domexception/-/node-domexception-1.0.0.tgz",
"integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==",
"optional": true
},
"parse-asn1": {
"version": "5.1.7",
"resolved": "https://registry.npmmirror.com/parse-asn1/-/parse-asn1-5.1.7.tgz",
@@ -1214,6 +1636,11 @@
"sha.js": "^2.4.8"
}
},
"process": {
"version": "0.11.10",
"resolved": "https://registry.npmmirror.com/process/-/process-0.11.10.tgz",
"integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A=="
},
"process-nextick-args": {
"version": "2.0.1",
"resolved": "https://registry.npmmirror.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
@@ -1302,8 +1729,7 @@
"safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.2.1.tgz",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
"dev": true
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
},
"sha.js": {
"version": "2.4.11",
@@ -1376,11 +1802,26 @@
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
"dev": true
},
"utilium": {
"version": "1.1.0",
"resolved": "https://registry.npmmirror.com/utilium/-/utilium-1.1.0.tgz",
"integrity": "sha512-02uMD58LHEacpSkzx46JZ0FDvFGpSGUYN6mSHY9wqNUi4sZVNzDdUXa9unLLCj5pRxK28HcYqqe/iQToBpmxTw==",
"requires": {
"@xterm/xterm": "^5.5.0",
"eventemitter3": "^5.0.1"
}
},
"vm-browserify": {
"version": "1.1.2",
"resolved": "https://registry.npmmirror.com/vm-browserify/-/vm-browserify-1.1.2.tgz",
"integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==",
"dev": true
},
"web-streams-polyfill": {
"version": "3.3.3",
"resolved": "https://registry.npmmirror.com/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz",
"integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==",
"optional": true
}
}
}

View File

@@ -18,6 +18,8 @@
},
"dependencies": {
"@basthon/kernel-loader": "^0.62.21",
"@zenfs/core": "^1.4.0",
"@zenfs/dom": "^1.0.6",
"idb-keyval": "^6.2.1"
},
"main": "./export.js",