@lvce-editor/typescript-compile-process 1.1.0 → 1.3.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.
package/README.md CHANGED
@@ -1,2 +1,3 @@
1
1
  # typescript-compile-process
2
+
2
3
  TypeScript compile process
package/dist/index.js CHANGED
@@ -3,11 +3,9 @@ import { handleJsonRpcMessage, resolve } from '@lvce-editor/json-rpc';
3
3
  import { IpcChildWithWebSocket, IpcChildWithElectronMessagePort, IpcChildWithElectronUtilityProcess, IpcChildWithNodeWorker, IpcChildWithNodeForkedProcess } from '@lvce-editor/ipc';
4
4
  import { VError } from '@lvce-editor/verror';
5
5
 
6
- const state$1 = {
7
- commands: Object.create(null)
8
- };
6
+ const commands = Object.create(null);
9
7
  const registerCommand = (key, fn) => {
10
- state$1.commands[key] = fn;
8
+ commands[key] = fn;
11
9
  };
12
10
  const registerCommands = commandMap => {
13
11
  for (const [key, value] of Object.entries(commandMap)) {
@@ -15,7 +13,7 @@ const registerCommands = commandMap => {
15
13
  }
16
14
  };
17
15
  const getCommand = key => {
18
- return state$1.commands[key];
16
+ return commands[key];
19
17
  };
20
18
 
21
19
  const execute = (command, ...args) => {
@@ -32,7 +30,7 @@ const prepare = error => {
32
30
  const requiresSocket = method => {
33
31
  return false;
34
32
  };
35
- const logError = (error, prettyError) => {
33
+ const logError = error => {
36
34
  console.error(error);
37
35
  };
38
36
  const handleMessage = event => {
@@ -109,9 +107,13 @@ const handleElectronMessagePort = async (messagePort, ipcId) => {
109
107
  handleIpc(ipc);
110
108
  };
111
109
 
110
+ const importScript = async url => {
111
+ return await import(url);
112
+ };
113
+
112
114
  const loadTypeScript = async typescriptPath => {
113
115
  try {
114
- const typescript = await import(typescriptPath);
116
+ const typescript = await importScript(typescriptPath);
115
117
  const actual = typescript.default;
116
118
  if (!actual) {
117
119
  throw new Error('missing default export');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/typescript-compile-process",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "TypeScript Compile Process",
5
5
  "main": "dist/index.js",
6
6
  "bin": "bin/typescriptCompileProcess.js",
@@ -18,11 +18,10 @@
18
18
  "node": ">=18"
19
19
  },
20
20
  "dependencies": {
21
- "@lvce-editor/assert": "^1.2.0",
22
- "@lvce-editor/ipc": "^9.1.0",
23
- "@lvce-editor/json-rpc": "^1.3.0",
24
- "@lvce-editor/pretty-error": "^1.5.0",
25
- "@lvce-editor/verror": "^1.3.0"
21
+ "@lvce-editor/assert": "^1.3.0",
22
+ "@lvce-editor/ipc": "^11.0.1",
23
+ "@lvce-editor/json-rpc": "^4.1.0",
24
+ "@lvce-editor/verror": "^1.4.0"
26
25
  },
27
26
  "xo": {
28
27
  "rules": {