@lvce-editor/typescript-compile-process 4.0.0 → 5.0.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.
Files changed (2) hide show
  1. package/dist/index.js +11 -11
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -427,7 +427,7 @@ const listen$a = () => {
427
427
  parentPort
428
428
  } = process;
429
429
  if (!parentPort) {
430
- throw new Error('parent port must be defined');
430
+ throw new IpcError('parent port must be defined');
431
431
  }
432
432
  return parentPort;
433
433
  };
@@ -485,7 +485,7 @@ const getTransferrablesNode = value => {
485
485
  };
486
486
  const listen$5 = async () => {
487
487
  if (!process.send) {
488
- throw new Error('process.send must be defined');
488
+ throw new IpcError('process.send must be defined');
489
489
  }
490
490
  return process;
491
491
  };
@@ -1168,12 +1168,12 @@ const Auto = () => {
1168
1168
 
1169
1169
  const getModule = method => {
1170
1170
  switch (method) {
1171
- case NodeForkedProcess:
1172
- return NodeForkedProcessRpcClient;
1173
- case ElectronUtilityProcess:
1174
- return ElectronUtilityProcessRpcClient;
1175
1171
  case ElectronMessagePort:
1176
1172
  return ElectronMessagePortRpcClient;
1173
+ case ElectronUtilityProcess:
1174
+ return ElectronUtilityProcessRpcClient;
1175
+ case NodeForkedProcess:
1176
+ return NodeForkedProcessRpcClient;
1177
1177
  case WebSocket:
1178
1178
  return WebSocketRpcParent;
1179
1179
  default:
@@ -1196,8 +1196,8 @@ const handleElectronMessagePort = async (messagePort, ipcId) => {
1196
1196
  // Assert.number(ipcId)
1197
1197
  // TODO use handleIncomingIpc function
1198
1198
  await listen$1({
1199
- method: ElectronMessagePort,
1200
- messagePort
1199
+ messagePort,
1200
+ method: ElectronMessagePort
1201
1201
  });
1202
1202
  };
1203
1203
 
@@ -1222,8 +1222,8 @@ const isModuleNotFoundError = error => {
1222
1222
  };
1223
1223
 
1224
1224
  class TypeScriptNotFoundError extends Error {
1225
- constructor() {
1226
- super('Failed to load typescript: Typescript not found');
1225
+ constructor(typescriptPath) {
1226
+ super(`Failed to load typescript: Typescript not found at "${typescriptPath}"`);
1227
1227
  this.code = 'E_TYPESCRIPT_NOT_FOUND';
1228
1228
  }
1229
1229
  }
@@ -1238,7 +1238,7 @@ const loadTypeScript = async typescriptPath => {
1238
1238
  return actual;
1239
1239
  } catch (error) {
1240
1240
  if (isModuleNotFoundError(error)) {
1241
- throw new TypeScriptNotFoundError();
1241
+ throw new TypeScriptNotFoundError(typescriptPath);
1242
1242
  }
1243
1243
  throw new VError(error, `Failed to load typescript`);
1244
1244
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/typescript-compile-process",
3
- "version": "4.0.0",
3
+ "version": "5.0.0",
4
4
  "description": "TypeScript Compile Process",
5
5
  "keywords": [
6
6
  "Lvce Editor"