@lvce-editor/search-process 1.2.0 → 1.4.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,7 @@
1
- # search-process
1
+ # Search Process
2
+
2
3
  Search process using ripgrep
4
+
5
+ ## Gitpod
6
+
7
+ [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/lvce-editor/search-process)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/search-process",
3
- "version": "1.2.0",
3
+ "version": "1.4.0",
4
4
  "description": "Search Process",
5
5
  "main": "src/searchProcessMain.js",
6
6
  "bin": "./bin/searchProcess.js",
@@ -19,10 +19,10 @@
19
19
  },
20
20
  "dependencies": {
21
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/verror": "^1.2.0",
25
- "execa": "^9.1.0"
22
+ "@lvce-editor/ipc": "^9.4.0",
23
+ "@lvce-editor/json-rpc": "^1.4.0",
24
+ "@lvce-editor/verror": "^1.4.0",
25
+ "execa": "^9.3.0"
26
26
  },
27
27
  "optionalDependencies": {
28
28
  "@lvce-editor/ripgrep": "^1.2.0"
@@ -1,12 +1,2 @@
1
- export const Backslash = '\\'
2
- export const Dash = '-'
3
- export const Dot = '.'
4
1
  export const EmptyString = ''
5
2
  export const NewLine = '\n'
6
- export const OpenAngleBracket = '<'
7
- export const Slash = '/'
8
- export const Space = ' '
9
- export const Tab = '\t'
10
- export const Underline = '_'
11
- export const T = 't'
12
- export const SemiColon = ';'
@@ -1,8 +1,8 @@
1
- export const state = {
1
+ const state = {
2
2
  commands: Object.create(null),
3
3
  }
4
4
 
5
- export const registerCommand = (key, fn) => {
5
+ const registerCommand = (key, fn) => {
6
6
  state.commands[key] = fn
7
7
  }
8
8
 
@@ -1,21 +1,3 @@
1
- export const getFolder = () => {
2
- return process.env.FOLDER
3
- }
4
-
5
- export const getAppImagePath = () => {
6
- return process.env.APPIMAGE
7
- }
8
-
9
- export const getElectronRunAsNode = () => {
10
- return process.env.ELECTRON_RUN_AS_NODE
11
- }
12
-
13
- export const getNodeEnv = () => {
14
- return process.env.NODE_ENV
15
- }
16
-
17
1
  export const getRipGrepPath = () => {
18
2
  return process.env.RIP_GREP_PATH
19
3
  }
20
-
21
- export const { env } = process
@@ -1,22 +1,2 @@
1
- export const E_COLOR_THEME_NOT_FOUND = 'E_COLOR_THEME_NOT_FOUND'
2
- export const E_COMMAND_NOT_FOUND = 'E_COMMAND_NOT_FOUND'
3
- export const E_ICON_THEME_NOT_FOUND = 'E_ICON_THEME_NOT_FOUND'
4
- export const E_INCOMPATIBLE_NATIVE_MODULE = 'E_INCOMPATIBLE_NATIVE_MODULE'
5
- export const E_MANIFEST_NOT_FOUND = 'E_MANIFEST_NOT_FOUND'
6
- export const E_MODULES_NOT_SUPPORTED_IN_ELECTRON = 'E_MODULES_NOT_SUPPORTED_IN_ELECTRON'
7
- export const E_JSON_PARSE = 'E_JSON_PARSE'
8
- export const EACCES = 'EACCES'
9
- export const ECONNRESET = 'ECONNRESET'
10
- export const EEXIST = 'EEXIST'
11
- export const EISDIR = 'EISDIR'
12
- export const ELOOP = 'ELOOP'
13
1
  export const ENOENT = 'ENOENT'
14
- export const ENOTDIR = 'ENOTDIR'
15
- export const EPERM = 'EPERM'
16
- export const EPIPE = 'EPIPE'
17
- export const ERR_IPC_CHANNEL_CLOSED = 'ERR_IPC_CHANNEL_CLOSED'
18
- export const ERR_MODULE_NOT_FOUND = 'ERR_MODULE_NOT_FOUND'
19
- export const EXDEV = 'EXDEV'
20
- export const ERR_DLOPEN_FAILED = 'ERR_DLOPEN_FAILED'
21
- export const ESRCH = 'ESRCH'
22
2
  export const E_RIP_GREP_NOT_FOUND = 'E_RIP_GREP_NOT_FOUND'
@@ -2,7 +2,6 @@ export const NodeWorker = 1
2
2
  export const NodeForkedProcess = 2
3
3
  export const ElectronUtilityProcess = 3
4
4
  export const ElectronMessagePort = 4
5
- export const NodeMessagePort = 5
6
5
  export const WebSocket = 6
7
6
 
8
7
  export const Auto = () => {
@@ -25,24 +25,12 @@ const getOrCreateLogger = () => {
25
25
  return state.console
26
26
  }
27
27
 
28
- export const log = (...args) => {
29
- const logger = getOrCreateLogger()
30
- logger.log(...args)
31
- console.log(...args)
32
- }
33
-
34
28
  export const info = (...args) => {
35
29
  const logger = getOrCreateLogger()
36
30
  logger.info(...args)
37
31
  console.info(...args)
38
32
  }
39
33
 
40
- export const warn = (...args) => {
41
- const logger = getOrCreateLogger()
42
- logger.warn(...args)
43
- console.warn(...args)
44
- }
45
-
46
34
  export const error = (...args) => {
47
35
  const logger = getOrCreateLogger()
48
36
  logger.error(...args)
@@ -1,4 +1,3 @@
1
1
  export const Begin = 'begin'
2
2
  export const Match = 'match'
3
3
  export const Summary = 'summary'
4
- export const Context = 'context'
@@ -1,22 +0,0 @@
1
- import * as fs from 'node:fs/promises'
2
- import * as Assert from '../Assert/Assert.js'
3
- import * as EncodingType from '../EncodingType/EncodingType.js'
4
- import { VError } from '../VError/VError.js'
5
-
6
- /**
7
- *
8
- * @param {string} path
9
- * @param {string} content
10
- * @param {BufferEncoding} encoding
11
- */
12
- export const writeFile = async (path, content, encoding = EncodingType.Utf8) => {
13
- try {
14
- Assert.string(path)
15
- Assert.string(content)
16
- // queue would be more correct for concurrent writes but also slower
17
- // Queue.add(`writeFile/${path}`, () =>
18
- await fs.writeFile(path, content, encoding)
19
- } catch (error) {
20
- throw new VError(error, `Failed to write to file "${path}"`)
21
- }
22
- }