atom.io 0.30.5 → 0.30.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atom.io",
3
- "version": "0.30.5",
3
+ "version": "0.30.6",
4
4
  "description": "Composable and testable reactive data library.",
5
5
  "homepage": "https://atom.io.fyi",
6
6
  "sideEffects": false,
@@ -57,35 +57,35 @@
57
57
  "@types/estree": "1.0.6",
58
58
  "@types/http-proxy": "1.17.15",
59
59
  "@types/npmlog": "7.0.0",
60
- "@types/react": "19.0.1",
60
+ "@types/react": "19.0.2",
61
61
  "@types/tmp": "0.2.6",
62
- "@typescript-eslint/parser": "8.17.0",
63
- "@typescript-eslint/rule-tester": "8.17.0",
64
- "@vitest/coverage-v8": "3.0.0-beta.1",
65
- "@vitest/ui": "3.0.0-beta.1",
66
- "concurrently": "9.1.0",
67
- "drizzle-kit": "0.29.1",
68
- "drizzle-orm": "0.37.0",
69
- "eslint": "9.16.0",
70
- "happy-dom": "15.11.7",
62
+ "@typescript-eslint/parser": "8.18.2",
63
+ "@typescript-eslint/rule-tester": "8.18.2",
64
+ "@vitest/coverage-v8": "3.0.0-beta.3",
65
+ "@vitest/ui": "3.0.0-beta.3",
66
+ "concurrently": "9.1.1",
67
+ "drizzle-kit": "0.30.1",
68
+ "drizzle-orm": "0.38.3",
69
+ "eslint": "9.17.0",
70
+ "happy-dom": "16.0.1",
71
71
  "http-proxy": "1.18.1",
72
- "motion": "11.13.1",
72
+ "motion": "11.15.0",
73
73
  "npmlog": "7.0.1",
74
74
  "postgres": "3.4.5",
75
- "preact": "10.25.1",
75
+ "preact": "10.25.4",
76
76
  "react": "19.0.0",
77
77
  "react-dom": "19.0.0",
78
- "react-router-dom": "7.0.2",
78
+ "react-router-dom": "7.1.1",
79
79
  "socket.io": "4.8.1",
80
80
  "socket.io-client": "4.8.1",
81
81
  "tmp": "0.2.3",
82
82
  "tsup": "8.3.5",
83
83
  "tsx": "4.19.2",
84
84
  "typescript": "5.7.2",
85
- "vite": "6.0.3",
85
+ "vite": "6.0.6",
86
86
  "vite-tsconfig-paths": "5.1.4",
87
- "vitest": "3.0.0-beta.1",
88
- "zod": "3.23.8"
87
+ "vitest": "3.0.0-beta.3",
88
+ "zod": "3.24.1"
89
89
  },
90
90
  "main": "dist/index.js",
91
91
  "types": "dist/index.d.ts",
@@ -30,24 +30,16 @@ declare class CustomSocket<I extends Events, O extends Events> implements Socket
30
30
  }
31
31
 
32
32
  declare class ChildSocket<I extends Events, O extends Events> extends CustomSocket<I, O> {
33
- process: ChildProcessWithoutNullStreams;
34
- key: string;
35
- logger: {
36
- info: (prefix: string, message: string, ...args: unknown[]) => void;
37
- warn: (prefix: string, message: string, ...args: unknown[]) => void;
38
- error: (prefix: string, message: string, ...args: unknown[]) => void;
39
- };
40
33
  protected incompleteData: string;
41
34
  protected unprocessedEvents: string[];
42
35
  protected incompleteLog: string;
43
36
  protected unprocessedLogs: string[];
44
37
  id: string;
38
+ process: ChildProcessWithoutNullStreams;
39
+ key: string;
40
+ logger: Pick<Console, `error` | `info` | `warn`>;
45
41
  protected handleLog(arg: Json.Serializable): void;
46
- constructor(process: ChildProcessWithoutNullStreams, key: string, logger?: {
47
- info: (prefix: string, message: string, ...args: unknown[]) => void;
48
- warn: (prefix: string, message: string, ...args: unknown[]) => void;
49
- error: (prefix: string, message: string, ...args: unknown[]) => void;
50
- });
42
+ constructor(process: ChildProcessWithoutNullStreams, key: string, logger?: Pick<Console, `error` | `info` | `warn`>);
51
43
  }
52
44
 
53
45
  declare class SubjectSocket<I extends Events, O extends Events> extends CustomSocket<I, O> {
@@ -61,7 +61,31 @@ var CustomSocket = class {
61
61
 
62
62
  // realtime-server/src/ipc-sockets/child-socket.ts
63
63
  var ChildSocket = class extends CustomSocket {
64
- constructor(process2, key, logger = console) {
64
+ incompleteData = ``;
65
+ unprocessedEvents = [];
66
+ incompleteLog = ``;
67
+ unprocessedLogs = [];
68
+ id = `#####`;
69
+ process;
70
+ key;
71
+ logger;
72
+ handleLog(arg) {
73
+ if (Array.isArray(arg)) {
74
+ const [level, ...rest] = arg;
75
+ switch (level) {
76
+ case `i`:
77
+ this.logger.info(...rest);
78
+ break;
79
+ case `w`:
80
+ this.logger.warn(...rest);
81
+ break;
82
+ case `e`:
83
+ this.logger.error(...rest);
84
+ break;
85
+ }
86
+ }
87
+ }
88
+ constructor(process2, key, logger) {
65
89
  super((event, ...args) => {
66
90
  const stringifiedEvent = JSON.stringify([event, ...args]) + ``;
67
91
  const errorHandler = (err) => {
@@ -76,8 +100,17 @@ var ChildSocket = class extends CustomSocket {
76
100
  });
77
101
  this.process = process2;
78
102
  this.key = key;
79
- this.logger = logger;
80
- this.process = process2;
103
+ this.logger = logger ?? {
104
+ info: (...args) => {
105
+ console.info(this.id, this.key, ...args);
106
+ },
107
+ warn: (...args) => {
108
+ console.warn(this.id, this.key, ...args);
109
+ },
110
+ error: (...args) => {
111
+ console.error(this.id, this.key, ...args);
112
+ }
113
+ };
81
114
  this.process.stdout.on(
82
115
  `data`,
83
116
  (buffer) => {
@@ -139,27 +172,6 @@ var ChildSocket = class extends CustomSocket {
139
172
  this.id = process2.pid.toString();
140
173
  }
141
174
  }
142
- incompleteData = ``;
143
- unprocessedEvents = [];
144
- incompleteLog = ``;
145
- unprocessedLogs = [];
146
- id = `#####`;
147
- handleLog(arg) {
148
- if (Array.isArray(arg)) {
149
- const [level, ...rest] = arg;
150
- switch (level) {
151
- case `i`:
152
- this.logger.info(this.id, this.key, ...rest);
153
- break;
154
- case `w`:
155
- this.logger.warn(this.id, this.key, ...rest);
156
- break;
157
- case `e`:
158
- this.logger.error(this.id, this.key, ...rest);
159
- break;
160
- }
161
- }
162
- }
163
175
  };
164
176
  var SubjectSocket = class extends CustomSocket {
165
177
  in;
@@ -1,4 +1,5 @@
1
1
  import type { ChildProcessWithoutNullStreams } from "node:child_process"
2
+ import type { Console } from "node:console"
2
3
 
3
4
  import type { Json } from "atom.io/json"
4
5
  import { parseJson } from "atom.io/json"
@@ -19,31 +20,31 @@ export class ChildSocket<
19
20
 
20
21
  public id = `#####`
21
22
 
23
+ public process: ChildProcessWithoutNullStreams
24
+ public key: string
25
+ public logger: Pick<Console, `error` | `info` | `warn`>
26
+
22
27
  protected handleLog(arg: Json.Serializable): void {
23
28
  if (Array.isArray(arg)) {
24
29
  const [level, ...rest] = arg
25
30
  switch (level) {
26
31
  case `i`:
27
- this.logger.info(this.id, this.key, ...rest)
32
+ this.logger.info(...rest)
28
33
  break
29
34
  case `w`:
30
- this.logger.warn(this.id, this.key, ...rest)
35
+ this.logger.warn(...rest)
31
36
  break
32
37
  case `e`:
33
- this.logger.error(this.id, this.key, ...rest)
38
+ this.logger.error(...rest)
34
39
  break
35
40
  }
36
41
  }
37
42
  }
38
43
 
39
44
  public constructor(
40
- public process: ChildProcessWithoutNullStreams,
41
- public key: string,
42
- public logger: {
43
- info: (prefix: string, message: string, ...args: unknown[]) => void
44
- warn: (prefix: string, message: string, ...args: unknown[]) => void
45
- error: (prefix: string, message: string, ...args: unknown[]) => void
46
- } = console,
45
+ process: ChildProcessWithoutNullStreams,
46
+ key: string,
47
+ logger?: Pick<Console, `error` | `info` | `warn`>,
47
48
  ) {
48
49
  super((event, ...args) => {
49
50
  const stringifiedEvent = JSON.stringify([event, ...args]) + `\x03`
@@ -60,6 +61,18 @@ export class ChildSocket<
60
61
  return this
61
62
  })
62
63
  this.process = process
64
+ this.key = key
65
+ this.logger = logger ?? {
66
+ info: (...args: unknown[]) => {
67
+ console.info(this.id, this.key, ...args)
68
+ },
69
+ warn: (...args: unknown[]) => {
70
+ console.warn(this.id, this.key, ...args)
71
+ },
72
+ error: (...args: unknown[]) => {
73
+ console.error(this.id, this.key, ...args)
74
+ },
75
+ }
63
76
  this.process.stdout.on(
64
77
  `data`,
65
78
  <Event extends keyof I>(buffer: EventBuffer<string, I[Event]>) => {