@lvce-editor/file-system-worker 5.12.0 → 5.14.0

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.
@@ -1799,7 +1799,7 @@ const getWatchCallbackIdsForUri = uri => {
1799
1799
  return watchIds;
1800
1800
  };
1801
1801
 
1802
- const watchFile$2 = async (id, uri, rpcId) => {
1802
+ const watchFile = async (id, uri, rpcId) => {
1803
1803
  assertUri(uri);
1804
1804
  const commandId = 'Output.executeWatchCallback';
1805
1805
  registerWatchCallback(id, rpcId, commandId, uri);
@@ -1924,9 +1924,6 @@ const copy$1 = async (oldUri, newUri) => {
1924
1924
  const getFolderSize$1 = async uri => {
1925
1925
  throw new Error('not implemented');
1926
1926
  };
1927
- const watchFile$1 = async (id, uri) => {
1928
- throw new Error('not implemented');
1929
- };
1930
1927
 
1931
1928
  const FileSystemMemory = {
1932
1929
  __proto__: null,
@@ -1944,7 +1941,6 @@ const FileSystemMemory = {
1944
1941
  remove: remove$1,
1945
1942
  rename: rename$1,
1946
1943
  stat: stat$1,
1947
- watchFile: watchFile$1,
1948
1944
  writeFile: writeFile$1
1949
1945
  };
1950
1946
 
@@ -2093,10 +2089,6 @@ const copy = async (oldUri, newUri) => {
2093
2089
  const getFolderSize = async uri => {
2094
2090
  return getFolderSize$2(uri);
2095
2091
  };
2096
- const watchFile = async (id, uri) => {
2097
- // @ts-ignore
2098
- await invoke$1('FileSystem.watchFile', id, uri);
2099
- };
2100
2092
 
2101
2093
  const FileSystemDisk = {
2102
2094
  __proto__: null,
@@ -2117,7 +2109,6 @@ const FileSystemDisk = {
2117
2109
  remove,
2118
2110
  rename,
2119
2111
  stat,
2120
- watchFile,
2121
2112
  writeBlob,
2122
2113
  writeFile
2123
2114
  };
@@ -2152,6 +2143,20 @@ const commandMapRef = {};
2152
2143
 
2153
2144
  const createFileSystemProcessRpcNode = async () => {
2154
2145
  try {
2146
+ try {
2147
+ const {
2148
+ protocols,
2149
+ url
2150
+ } = await invoke$2('WebSocketCapability.create', 'file-system-process');
2151
+ return await create$3({
2152
+ commandMap: commandMapRef,
2153
+ webSocket: new WebSocket(url, protocols)
2154
+ });
2155
+ } catch (error) {
2156
+ if (!(error instanceof Error && (error.message.includes('WebSocketCapability.create') || error.message.includes('module WebSocketCapability not found')) && /command not found|not found/i.test(error.message))) {
2157
+ throw error;
2158
+ }
2159
+ }
2155
2160
  const rpc = await create$2({
2156
2161
  commandMap: commandMapRef,
2157
2162
  type: 'file-system-process'
@@ -2320,7 +2325,7 @@ const commandMap = {
2320
2325
  'FileSystem.stat': stat,
2321
2326
  'FileSystem.unwatchFile': unwatchFile,
2322
2327
  'FileSystem.uploadFileSystemHandles': uploadFileSystemHandles,
2323
- 'FileSystem.watchFile': watchFile$2,
2328
+ 'FileSystem.watchFile': watchFile,
2324
2329
  'FileSystem.writeBlob': writeBlob,
2325
2330
  'FileSystem.writeFile': writeFile,
2326
2331
  'Initialize.initialize': initialize
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/file-system-worker",
3
- "version": "5.12.0",
3
+ "version": "5.14.0",
4
4
  "description": "File System Worker",
5
5
  "keywords": [
6
6
  "Lvce Editor"