silgi 0.43.19 → 0.43.21

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.
@@ -14,17 +14,23 @@ async function getProcessesOnPort(port) {
14
14
  const lines = output.split("\n");
15
15
  for (const line of lines) if (line.includes(`:${port}`) && line.includes("LISTENING")) {
16
16
  const parts = line.trim().split(/\s+/);
17
- const pid = Number.parseInt(parts[parts.length - 1]);
18
- if (pid && pid !== 0) try {
17
+ const pidStr = parts[parts.length - 1];
18
+ if (!pidStr) continue;
19
+ const pid = Number.parseInt(pidStr);
20
+ if (pid && pid !== 0 && !Number.isNaN(pid)) try {
19
21
  const taskList = execSync(`tasklist /FI "PID eq ${pid}" /FO CSV`, { encoding: "utf8" });
20
- const processLine = taskList.split("\n")[1];
22
+ const lines$1 = taskList.split("\n");
23
+ const processLine = lines$1[1];
21
24
  if (processLine) {
22
- const name = processLine.split(",")[0].replace(/"/g, "");
23
- processes.push({
24
- pid,
25
- name,
26
- port
27
- });
25
+ const namePart = processLine.split(",")[0];
26
+ if (namePart) {
27
+ const name = namePart.replace(/"/g, "");
28
+ processes.push({
29
+ pid,
30
+ name,
31
+ port
32
+ });
33
+ }
28
34
  }
29
35
  } catch {
30
36
  processes.push({
@@ -40,8 +46,10 @@ async function getProcessesOnPort(port) {
40
46
  for (const line of lines) if (line.trim()) {
41
47
  const parts = line.trim().split(/\s+/);
42
48
  const name = parts[0];
43
- const pid = Number.parseInt(parts[1]);
44
- if (pid && !processes.some((p) => p.pid === pid)) processes.push({
49
+ const pidStr = parts[1];
50
+ if (!name || !pidStr) continue;
51
+ const pid = Number.parseInt(pidStr);
52
+ if (pid && !Number.isNaN(pid) && !processes.some((p) => p.pid === pid)) processes.push({
45
53
  pid,
46
54
  name,
47
55
  port
@@ -103,8 +111,10 @@ async function killNodeProcessesInDirectory(directory) {
103
111
  const lines = output.split("\n");
104
112
  for (const line of lines) if (line.includes(directory)) {
105
113
  const parts = line.split(",");
106
- const pid = Number.parseInt(parts[parts.length - 1]);
107
- if (pid) {
114
+ const pidStr = parts[parts.length - 1];
115
+ if (!pidStr) continue;
116
+ const pid = Number.parseInt(pidStr);
117
+ if (pid && !Number.isNaN(pid)) {
108
118
  consola.info(`Killing node process ${pid} in ${directory}`);
109
119
  if (await killProcessTree(pid)) killedCount++;
110
120
  }
@@ -114,8 +124,10 @@ async function killNodeProcessesInDirectory(directory) {
114
124
  const lines = output.split("\n");
115
125
  for (const line of lines) if (line.includes("node") && line.includes(directory)) {
116
126
  const parts = line.trim().split(/\s+/);
117
- const pid = Number.parseInt(parts[1]);
118
- if (pid) {
127
+ const pidStr = parts[1];
128
+ if (!pidStr) continue;
129
+ const pid = Number.parseInt(pidStr);
130
+ if (pid && !Number.isNaN(pid)) {
119
131
  consola.info(`Killing node process ${pid} in ${directory}`);
120
132
  if (await killProcessTree(pid)) killedCount++;
121
133
  }
package/dist/package.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  //#region package.json
2
2
  var name = "silgi";
3
3
  var type = "module";
4
- var version = "0.43.19";
4
+ var version = "0.43.21";
5
5
  var private$1 = false;
6
6
  var packageManager = "pnpm@10.12.4";
7
7
  var sideEffects = false;
@@ -5,7 +5,7 @@ import { Session } from "h3";
5
5
 
6
6
  //#region src/types/event.d.ts
7
7
  interface ExtendContext {}
8
- interface SilgiRuntimeContext extends Record<string, any> {
8
+ interface SilgiRuntimeContext extends ExtendContext, Record<string, any> {
9
9
  /* Matched router parameters */
10
10
  params?: Record<string, string>;
11
11
  protocol: EventProtocol;
@@ -1,9 +1,9 @@
1
1
  import { SilgiCLI } from "./silgiCLI.mjs";
2
2
  import { BuildSilgi } from "./silgi.mjs";
3
3
  import { ESMCodeGenOptions, ESMImport } from "knitwork";
4
- import * as h32 from "h3";
4
+ import * as h33 from "h3";
5
5
  import { PresetName } from "silgi/presets";
6
- import * as nitropack_types0 from "nitropack/types";
6
+ import * as nitropack_types1 from "nitropack/types";
7
7
 
8
8
  //#region src/types/kits.d.ts
9
9
  interface SilgiCommands {}
@@ -24,7 +24,7 @@ interface GenImport {
24
24
  imports: ESMImport | ESMImport[];
25
25
  options?: ESMCodeGenOptions;
26
26
  }
27
- type Framework<T extends PresetName> = T extends "nitro" ? nitropack_types0.NitroApp : T extends "nuxt" ? nitropack_types0.NitroApp : T extends "h3" ? h32.Router : never;
27
+ type Framework<T extends PresetName> = T extends "nitro" ? nitropack_types1.NitroApp : T extends "nuxt" ? nitropack_types1.NitroApp : T extends "h3" ? h33.Router : never;
28
28
  interface DefineFrameworkOptions<T extends PresetName> extends Omit<BuildSilgi, "framework"> {
29
29
  framework: Framework<T>;
30
30
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.43.19",
4
+ "version": "0.43.21",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {