silgi 0.43.7 → 0.43.9
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/dist/build.d.mts +2 -2
- package/dist/cli/build/dev.d.mts +1 -1
- package/dist/cli/build/prepare.d.mts +1 -1
- package/dist/cli/commands/init.mjs +1 -1
- package/dist/cli/commands/run.mjs +51 -54
- package/dist/cli/config/index.d.mts +2 -2
- package/dist/cli/config/loader.d.mts +1 -1
- package/dist/cli/config/resolvers/compatibility.mjs +1 -1
- package/dist/cli/config/types.d.mts +1 -1
- package/dist/cli/core/app.mjs +1 -1
- package/dist/cli/index.mjs +1 -1
- package/dist/cli/module/install.mjs +1 -1
- package/dist/cli/module/scan.mjs +6 -6
- package/dist/cli/scan/prepareCommands.mjs +1 -1
- package/dist/cli/scan/scanExportFile.mjs +3 -3
- package/dist/cli/scan/writeTypesAndFiles.mjs +1 -1
- package/dist/cli/utils/compatibility.mjs +1 -1
- package/dist/core/context.d.mts +1 -1
- package/dist/core/createSilgi.d.mts +1 -1
- package/dist/core/error.d.mts +1 -1
- package/dist/core/event.d.mts +1 -1
- package/dist/core/index.d.mts +19 -19
- package/dist/core/index.mjs +1 -1
- package/dist/core/response.d.mts +2 -2
- package/dist/core/silgi.d.mts +1 -1
- package/dist/core/silgiApp.d.mts +1 -1
- package/dist/core/storage.d.mts +1 -1
- package/dist/core/unctx.d.mts +1 -1
- package/dist/core/utils/event-stream.d.mts +2 -2
- package/dist/core/utils/event.d.mts +1 -1
- package/dist/core/utils/internal/event-stream.d.mts +1 -1
- package/dist/core/utils/merge.d.mts +1 -1
- package/dist/core/utils/middleware.d.mts +1 -1
- package/dist/core/utils/resolver.d.mts +1 -1
- package/dist/core/utils/resolver.mjs +1 -1
- package/dist/core/utils/runtime.d.mts +1 -1
- package/dist/core/utils/schema.d.mts +1 -1
- package/dist/core/utils/service.d.mts +1 -1
- package/dist/core/utils/shared.d.mts +1 -1
- package/dist/core/utils/storage.d.mts +1 -1
- package/dist/index.d.mts +19 -19
- package/dist/index.mjs +1 -1
- package/dist/kit/add/add-commands.d.mts +1 -1
- package/dist/kit/add/add-core-file.d.mts +1 -1
- package/dist/kit/add/add-imports.d.mts +1 -1
- package/dist/kit/add/add-npm.d.mts +1 -1
- package/dist/kit/define.d.mts +1 -1
- package/dist/kit/errors.d.mts +1 -1
- package/dist/kit/esm.d.mts +1 -1
- package/dist/kit/fs.d.mts +1 -1
- package/dist/kit/function-utils.d.mts +1 -1
- package/dist/kit/function-utils.mjs +1 -1
- package/dist/kit/gen.d.mts +1 -1
- package/dist/kit/hash.d.mts +1 -1
- package/dist/kit/index.d.mts +21 -21
- package/dist/kit/isFramework.d.mts +1 -1
- package/dist/kit/logger.d.mts +1 -1
- package/dist/kit/migration.d.mts +1 -1
- package/dist/kit/migration.mjs +1 -1
- package/dist/kit/module.d.mts +1 -1
- package/dist/kit/path.d.mts +1 -1
- package/dist/kit/preset.d.mts +1 -1
- package/dist/kit/resolve.d.mts +1 -1
- package/dist/kit/template.d.mts +1 -1
- package/dist/kit/useRequest.d.mts +1 -1
- package/dist/kit/utils.d.mts +1 -1
- package/dist/package.mjs +11 -10
- package/dist/types/kits.d.mts +3 -3
- package/dist/types/tree-kill.d.mts +18 -0
- package/dist/types/tree-kill.mjs +0 -0
- package/package.json +19 -18
package/dist/build.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { watchDev
|
|
2
|
-
import { prepareBuild
|
|
1
|
+
import { watchDev } from "./cli/build/dev.mjs";
|
|
2
|
+
import { prepareBuild } from "./cli/build/prepare.mjs";
|
|
3
3
|
export { prepareBuild, watchDev };
|
package/dist/cli/build/dev.d.mts
CHANGED
|
@@ -45,7 +45,7 @@ const command = defineCommand({
|
|
|
45
45
|
"",
|
|
46
46
|
"export default defineSilgiConfig({",
|
|
47
47
|
` preset: '${framework}',`,
|
|
48
|
-
` compatibilityDate: '${new Date().toISOString().split("T")[0]}',`,
|
|
48
|
+
` compatibilityDate: '${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}',`,
|
|
49
49
|
"",
|
|
50
50
|
"})",
|
|
51
51
|
""
|
|
@@ -4,11 +4,39 @@ import prepare_default from "./prepare.mjs";
|
|
|
4
4
|
import consola from "consola";
|
|
5
5
|
import { useSilgiCLI } from "silgi";
|
|
6
6
|
import { version } from "silgi/meta";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { runCommand } from "citty";
|
|
8
|
+
import { spawn } from "node:child_process";
|
|
9
|
+
import { platform } from "node:os";
|
|
10
|
+
import { promisify } from "node:util";
|
|
11
|
+
import treeKill from "tree-kill";
|
|
9
12
|
|
|
10
13
|
//#region src/cli/commands/run.ts
|
|
11
|
-
const
|
|
14
|
+
const treeKillAsync = promisify(treeKill);
|
|
15
|
+
function waitForProcess(proc) {
|
|
16
|
+
return new Promise((resolve, reject) => {
|
|
17
|
+
proc.on("exit", (code) => resolve(code ?? 0));
|
|
18
|
+
proc.on("error", (err) => reject(err));
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
async function killProcessTree(pid, signal = "SIGTERM") {
|
|
22
|
+
try {
|
|
23
|
+
await treeKillAsync(pid, signal);
|
|
24
|
+
return true;
|
|
25
|
+
} catch (error) {
|
|
26
|
+
consola.warn(`Failed to kill process tree for PID ${pid}:`, error);
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function setupSignalHandlers(onSignal) {
|
|
31
|
+
const signals = [
|
|
32
|
+
"SIGINT",
|
|
33
|
+
"SIGTERM",
|
|
34
|
+
"SIGHUP"
|
|
35
|
+
];
|
|
36
|
+
signals.forEach((signal) => process.on(signal, () => onSignal(signal)));
|
|
37
|
+
return () => signals.forEach((signal) => process.off(signal, () => onSignal(signal)));
|
|
38
|
+
}
|
|
39
|
+
const command = {
|
|
12
40
|
meta: {
|
|
13
41
|
name: "dev",
|
|
14
42
|
description: "Start the development server for the project",
|
|
@@ -33,72 +61,41 @@ const command = defineCommand({
|
|
|
33
61
|
const startCommand = args.command || rawArgs[0];
|
|
34
62
|
let childPid = null;
|
|
35
63
|
let hasExited = false;
|
|
36
|
-
|
|
37
|
-
const cleanupAndExit = (code = 0) => {
|
|
64
|
+
const cleanupAndExit = async (code = 0) => {
|
|
38
65
|
if (hasExited) return;
|
|
39
66
|
hasExited = true;
|
|
40
|
-
if (exitTimeout) clearTimeout(exitTimeout);
|
|
41
67
|
process.exit(code);
|
|
42
68
|
};
|
|
43
|
-
const handleSignal = async (signal, watcher) => {
|
|
44
|
-
consola.info(`Received ${signal}, terminating process...`);
|
|
45
|
-
if (watcher && typeof watcher.close === "function") try {
|
|
46
|
-
await watcher.close();
|
|
47
|
-
} catch {}
|
|
48
|
-
if (childPid) {
|
|
49
|
-
try {
|
|
50
|
-
process.kill(childPid, signal);
|
|
51
|
-
} catch (err) {
|
|
52
|
-
consola.error(`Failed to kill process: ${err instanceof Error ? err.message : err}`);
|
|
53
|
-
}
|
|
54
|
-
exitTimeout = setTimeout(() => {
|
|
55
|
-
consola.warn("Process did not exit gracefully, forcing termination...");
|
|
56
|
-
try {
|
|
57
|
-
if (childPid) process.kill(childPid, "SIGKILL");
|
|
58
|
-
} catch {}
|
|
59
|
-
cleanupAndExit(1);
|
|
60
|
-
}, 3e3);
|
|
61
|
-
} else cleanupAndExit(0);
|
|
62
|
-
};
|
|
63
|
-
const setupSignalHandlers = (watcher) => {
|
|
64
|
-
[
|
|
65
|
-
"SIGINT",
|
|
66
|
-
"SIGTERM",
|
|
67
|
-
"SIGHUP"
|
|
68
|
-
].forEach((signal) => {
|
|
69
|
-
process.on(signal, () => {
|
|
70
|
-
handleSignal(signal, watcher);
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
};
|
|
74
69
|
try {
|
|
75
70
|
const watcher = await watchDev();
|
|
76
|
-
setupSignalHandlers(
|
|
71
|
+
const removeSignalHandlers = setupSignalHandlers(async (signal) => {
|
|
72
|
+
consola.info(`Received ${signal}, terminating process...`);
|
|
73
|
+
if (watcher?.close) await watcher.close().catch(() => {});
|
|
74
|
+
if (childPid) await killProcessTree(childPid, signal);
|
|
75
|
+
await cleanupAndExit(0);
|
|
76
|
+
});
|
|
77
77
|
consola.info(`Starting command: nr ${startCommand}`);
|
|
78
|
-
const
|
|
78
|
+
const isWindows = platform() === "win32";
|
|
79
|
+
const proc = spawn("nr", [startCommand], {
|
|
79
80
|
stdio: "inherit",
|
|
80
81
|
shell: true,
|
|
81
82
|
cwd: process.cwd(),
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
consola.error(`Process exited with code: ${exitCode}`);
|
|
92
|
-
if (silgi.options.debug) consola.withTag("silgi").error("Error while running the command", procError);
|
|
93
|
-
cleanupAndExit(exitCode);
|
|
94
|
-
}
|
|
83
|
+
...!isWindows && { detached: true }
|
|
84
|
+
});
|
|
85
|
+
childPid = proc.pid ?? null;
|
|
86
|
+
if (!childPid) throw new Error("Failed to start child process: no PID assigned");
|
|
87
|
+
const exitCode = await waitForProcess(proc);
|
|
88
|
+
if (exitCode !== 0) consola.error(`Process exited with code ${exitCode}`);
|
|
89
|
+
else consola.success("Process exited successfully.");
|
|
90
|
+
removeSignalHandlers();
|
|
91
|
+
await cleanupAndExit(exitCode);
|
|
95
92
|
} catch (error) {
|
|
96
93
|
consola.error(`Failed to start the development server: ${error instanceof Error ? error.message : error}`);
|
|
97
94
|
if (silgi.options.debug) consola.withTag("silgi").error("Error while running the command", error);
|
|
98
|
-
cleanupAndExit(1);
|
|
95
|
+
await cleanupAndExit(1);
|
|
99
96
|
}
|
|
100
97
|
}
|
|
101
|
-
}
|
|
98
|
+
};
|
|
102
99
|
var run_default = command;
|
|
103
100
|
|
|
104
101
|
//#endregion
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { loadOptions
|
|
2
|
-
import { silgiGenerateType
|
|
1
|
+
import { loadOptions } from "./loader.mjs";
|
|
2
|
+
import { silgiGenerateType } from "./types.mjs";
|
|
3
3
|
export { loadOptions, silgiGenerateType };
|
|
@@ -3,4 +3,4 @@ import { LoadConfigOptions, SilgiCLIConfig, SilgiCLIOptions } from "silgi/types"
|
|
|
3
3
|
//#region src/cli/config/loader.d.ts
|
|
4
4
|
declare function loadOptions(configOverrides?: SilgiCLIConfig, opts?: LoadConfigOptions): Promise<SilgiCLIOptions>;
|
|
5
5
|
//#endregion
|
|
6
|
-
export { loadOptions
|
|
6
|
+
export { loadOptions };
|
|
@@ -12,7 +12,7 @@ async function resolveCompatibilityOptions(options) {
|
|
|
12
12
|
let _fallbackInfoShown = false;
|
|
13
13
|
let _promptedUserToUpdate = false;
|
|
14
14
|
async function _resolveDefault(options) {
|
|
15
|
-
const _todayDate = formatDate(new Date());
|
|
15
|
+
const _todayDate = formatDate(/* @__PURE__ */ new Date());
|
|
16
16
|
const consola$2 = consola.withTag("silgi");
|
|
17
17
|
consola$2.warn(`No valid compatibility date is specified.`);
|
|
18
18
|
const onFallback = () => {
|
package/dist/cli/core/app.mjs
CHANGED
|
@@ -42,7 +42,7 @@ async function generateApp(app, options = {}) {
|
|
|
42
42
|
}
|
|
43
43
|
const templateContext = { app };
|
|
44
44
|
const writes = [];
|
|
45
|
-
const dirs = new Set();
|
|
45
|
+
const dirs = /* @__PURE__ */ new Set();
|
|
46
46
|
const changedTemplates = [];
|
|
47
47
|
async function processTemplate(template) {
|
|
48
48
|
let dir;
|
package/dist/cli/index.mjs
CHANGED
package/dist/cli/module/scan.mjs
CHANGED
|
@@ -103,12 +103,12 @@ async function scanModules(silgi) {
|
|
|
103
103
|
silgi.scanModules = modules;
|
|
104
104
|
}
|
|
105
105
|
function createDependencyGraph(modules) {
|
|
106
|
-
const graph = new Map();
|
|
107
|
-
const inDegree = new Map();
|
|
106
|
+
const graph = /* @__PURE__ */ new Map();
|
|
107
|
+
const inDegree = /* @__PURE__ */ new Map();
|
|
108
108
|
modules.forEach((module) => {
|
|
109
109
|
const key = module.meta?.configKey;
|
|
110
110
|
if (key) {
|
|
111
|
-
graph.set(key, new Set());
|
|
111
|
+
graph.set(key, /* @__PURE__ */ new Set());
|
|
112
112
|
inDegree.set(key, 0);
|
|
113
113
|
}
|
|
114
114
|
});
|
|
@@ -118,7 +118,7 @@ function createDependencyGraph(modules) {
|
|
|
118
118
|
const requiredDeps = module.meta?.requiredDependencies || [];
|
|
119
119
|
const beforeDeps = module.meta?.beforeDependencies || [];
|
|
120
120
|
const afterDeps = module.meta?.afterDependencies || [];
|
|
121
|
-
const processedDeps = new Set();
|
|
121
|
+
const processedDeps = /* @__PURE__ */ new Set();
|
|
122
122
|
requiredDeps.forEach((dep) => {
|
|
123
123
|
if (!graph.has(dep)) throw new Error(`Required dependency "${dep}" for module "${key}" is missing`);
|
|
124
124
|
graph.get(dep)?.add(key);
|
|
@@ -143,8 +143,8 @@ function createDependencyGraph(modules) {
|
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
145
|
function findCyclicDependencies(graph) {
|
|
146
|
-
const visited = new Set();
|
|
147
|
-
const recursionStack = new Set();
|
|
146
|
+
const visited = /* @__PURE__ */ new Set();
|
|
147
|
+
const recursionStack = /* @__PURE__ */ new Set();
|
|
148
148
|
const cycles = [];
|
|
149
149
|
function dfs(node, path = []) {
|
|
150
150
|
visited.add(node);
|
|
@@ -19,7 +19,7 @@ async function prepareCommands(silgi = useSilgiCLI()) {
|
|
|
19
19
|
if (command.tags) command.tags.forEach((tag) => acc.add(tag));
|
|
20
20
|
});
|
|
21
21
|
return acc;
|
|
22
|
-
}, new Set());
|
|
22
|
+
}, /* @__PURE__ */ new Set());
|
|
23
23
|
const data = [
|
|
24
24
|
genAugmentation("silgi/types", { SilgiCommands: { ...Object.fromEntries(Array.from(allTags.values()).map((tag) => [tag, "string"])) } }),
|
|
25
25
|
"",
|
|
@@ -152,7 +152,7 @@ async function extractExportEntitiesFromFile(absoluteFilePath, functionExportNam
|
|
|
152
152
|
const exportEntities = [];
|
|
153
153
|
const fileContent = await readFile(absoluteFilePath, "utf-8");
|
|
154
154
|
const parsed = await parseAsync(absoluteFilePath, fileContent);
|
|
155
|
-
const variableDeclarations = new Map();
|
|
155
|
+
const variableDeclarations = /* @__PURE__ */ new Map();
|
|
156
156
|
for (const node of parsed.program.body) {
|
|
157
157
|
if (node.type === "VariableDeclaration" && Array.isArray(node.declarations)) {
|
|
158
158
|
for (const decl of node.declarations) if (decl.type === "VariableDeclarator" && decl.id.type === "Identifier") variableDeclarations.set(decl.id.name, decl);
|
|
@@ -224,7 +224,7 @@ async function extractExportEntitiesFromFile(absoluteFilePath, functionExportNam
|
|
|
224
224
|
return exportEntities;
|
|
225
225
|
}
|
|
226
226
|
async function scanSilgiExports(path, packageName, silgiInstance = useSilgiCLI(), scanOptions = {}) {
|
|
227
|
-
const processedFilePaths = new Set();
|
|
227
|
+
const processedFilePaths = /* @__PURE__ */ new Set();
|
|
228
228
|
const alreadyScannedPaths = [];
|
|
229
229
|
const serverDirectory = path || silgiInstance.options.serverDir;
|
|
230
230
|
const functionExportNames = scanOptions.functionExportNames ?? DEFAULT_FUNCTION_EXPORT_NAMES;
|
|
@@ -263,7 +263,7 @@ async function scanSilgiExports(path, packageName, silgiInstance = useSilgiCLI()
|
|
|
263
263
|
if (!silgiInstance.options.extensions?.includes(fileExtension)) continue;
|
|
264
264
|
try {
|
|
265
265
|
const exportEntities = await extractExportEntitiesFromFile(absoluteFilePath, functionExportNames, interfaceExtendsNames);
|
|
266
|
-
const seenServiceSignatures = new Map();
|
|
266
|
+
const seenServiceSignatures = /* @__PURE__ */ new Map();
|
|
267
267
|
for (const entity of exportEntities) if ((entity.funcName === "createService" || entity.funcName === "createWebSocket") && entity.servicePath && entity.serviceMethod) {
|
|
268
268
|
const key = `${entity.serviceMethod}:${entity.servicePath}`;
|
|
269
269
|
if (seenServiceSignatures.has(key)) throw new Error(`Duplicate ${entity.funcName} detected for path "${entity.servicePath}" and method "${entity.serviceMethod}".\nFirst found in: ${seenServiceSignatures.get(key)}\nDuplicate in: ${absoluteFilePath}\nPlease ensure each service path/method combination is unique.`);
|
|
@@ -24,7 +24,7 @@ async function writeTypesAndFiles(silgi) {
|
|
|
24
24
|
await silgi.unimport.init();
|
|
25
25
|
const allImports = await silgi.unimport.getImports();
|
|
26
26
|
autoImportExports = toExports(allImports).replace(/#internal\/nitro/g, relative(typesDir, runtimeDir));
|
|
27
|
-
const resolvedImportPathMap = new Map();
|
|
27
|
+
const resolvedImportPathMap = /* @__PURE__ */ new Map();
|
|
28
28
|
for (const i of allImports.filter((i$1) => !i$1.type)) {
|
|
29
29
|
if (resolvedImportPathMap.has(i.from)) continue;
|
|
30
30
|
let path = resolveAlias$1(i.from, silgi.options.alias);
|
package/dist/core/context.d.mts
CHANGED
package/dist/core/error.d.mts
CHANGED
|
@@ -62,4 +62,4 @@ declare function createError<DataT = unknown>(input: string | (Partial<SilgiErro
|
|
|
62
62
|
*/
|
|
63
63
|
declare function isError<DataT = unknown>(input: any): input is SilgiError<DataT>;
|
|
64
64
|
//#endregion
|
|
65
|
-
export { SilgiError
|
|
65
|
+
export { SilgiError, createError, isError };
|
package/dist/core/event.d.mts
CHANGED
package/dist/core/index.d.mts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { updateRuntimeStorage
|
|
2
|
-
import { createSilgi
|
|
3
|
-
import { SilgiError
|
|
4
|
-
import { SilgiHttpEvent
|
|
5
|
-
import { handleResponse
|
|
6
|
-
import { getWebsocket
|
|
7
|
-
import { silgiCLICtx
|
|
8
|
-
import { storageMount
|
|
9
|
-
import { silgiCtx
|
|
10
|
-
import { createEventStream
|
|
11
|
-
import { getEvent
|
|
12
|
-
import { deepMergeObjects
|
|
13
|
-
import { createMiddleware
|
|
14
|
-
import { createResolver
|
|
15
|
-
import { replaceRuntimeValues
|
|
16
|
-
import { createSchema
|
|
17
|
-
import { createService
|
|
18
|
-
import { createShared
|
|
19
|
-
import { createStorage
|
|
1
|
+
import { updateRuntimeStorage, useRuntime } from "./context.mjs";
|
|
2
|
+
import { createSilgi } from "./createSilgi.mjs";
|
|
3
|
+
import { SilgiError, createError, isError } from "./error.mjs";
|
|
4
|
+
import { SilgiHttpEvent } from "./event.mjs";
|
|
5
|
+
import { handleResponse, kHandled, kNotFound } from "./response.mjs";
|
|
6
|
+
import { getWebsocket, handler, middleware, silgiFetch } from "./silgi.mjs";
|
|
7
|
+
import { silgiCLICtx, tryUseSilgiCLI, useSilgiCLI } from "./silgiApp.mjs";
|
|
8
|
+
import { storageMount } from "./storage.mjs";
|
|
9
|
+
import { silgiCtx, tryUseSilgi, useSilgi } from "./unctx.mjs";
|
|
10
|
+
import { createEventStream } from "./utils/event-stream.mjs";
|
|
11
|
+
import { getEvent, getEventContext } from "./utils/event.mjs";
|
|
12
|
+
import { deepMergeObjects } from "./utils/merge.mjs";
|
|
13
|
+
import { createMiddleware } from "./utils/middleware.mjs";
|
|
14
|
+
import { createResolver, getUrlPrefix } from "./utils/resolver.mjs";
|
|
15
|
+
import { replaceRuntimeValues } from "./utils/runtime.mjs";
|
|
16
|
+
import { createSchema } from "./utils/schema.mjs";
|
|
17
|
+
import { createService, createWebSocket, defineServiceSetup } from "./utils/service.mjs";
|
|
18
|
+
import { createShared } from "./utils/shared.mjs";
|
|
19
|
+
import { createStorage, useSilgiStorage } from "./utils/storage.mjs";
|
|
20
20
|
|
|
21
21
|
//#region src/core/index.d.ts
|
|
22
22
|
// TODO: bunlari yinede destekle.
|
package/dist/core/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { createStorage, useSilgiStorage } from "./utils/storage.mjs";
|
|
|
7
7
|
import { createSilgi } from "./createSilgi.mjs";
|
|
8
8
|
import { SilgiHttpEvent } from "./event.mjs";
|
|
9
9
|
import { handleResponse, kHandled, kNotFound } from "./response.mjs";
|
|
10
|
-
import { createResolver
|
|
10
|
+
import { createResolver, getUrlPrefix } from "./utils/resolver.mjs";
|
|
11
11
|
import { getWebsocket, handler, middleware, silgiFetch } from "./silgi.mjs";
|
|
12
12
|
import { storageMount } from "./storage.mjs";
|
|
13
13
|
import { createEventStream } from "./utils/event-stream.mjs";
|
package/dist/core/response.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SilgiError
|
|
1
|
+
import { SilgiError } from "./error.mjs";
|
|
2
2
|
import { SilgiEvent } from "silgi/types";
|
|
3
3
|
|
|
4
4
|
//#region src/core/response.d.ts
|
|
@@ -17,4 +17,4 @@ declare const kNotFound: symbol;
|
|
|
17
17
|
declare const kHandled: symbol;
|
|
18
18
|
declare function handleResponse(val: unknown, event: SilgiEvent, config: SilgiHandlerConfig): Response | Promise<Response>;
|
|
19
19
|
//#endregion
|
|
20
|
-
export { handleResponse
|
|
20
|
+
export { handleResponse, kHandled, kNotFound };
|
package/dist/core/silgi.d.mts
CHANGED
|
@@ -16,4 +16,4 @@ declare function middleware(event: SilgiEvent): Promise<any>;
|
|
|
16
16
|
declare function handler(event: SilgiEvent): Promise<any>;
|
|
17
17
|
declare function getWebsocket(silgi?: Silgi): WebSocketOptions;
|
|
18
18
|
//#endregion
|
|
19
|
-
export { getWebsocket
|
|
19
|
+
export { getWebsocket, handler, middleware, silgiFetch };
|
package/dist/core/silgiApp.d.mts
CHANGED
|
@@ -6,4 +6,4 @@ declare const silgiCLICtx: UseContext<SilgiCLI>;
|
|
|
6
6
|
declare function useSilgiCLI(): SilgiCLI;
|
|
7
7
|
declare function tryUseSilgiCLI(): SilgiCLI | null;
|
|
8
8
|
//#endregion
|
|
9
|
-
export { silgiCLICtx
|
|
9
|
+
export { silgiCLICtx, tryUseSilgiCLI, useSilgiCLI };
|
package/dist/core/storage.d.mts
CHANGED
|
@@ -4,4 +4,4 @@ import { Silgi, SilgiStorageBase } from "silgi/types";
|
|
|
4
4
|
//#region src/core/storage.d.ts
|
|
5
5
|
declare function storageMount<T extends Storage = Storage>(silgi?: Silgi): (base: keyof SilgiStorageBase, driver: Parameters<Storage["mount"]>[1]) => T;
|
|
6
6
|
//#endregion
|
|
7
|
-
export { storageMount
|
|
7
|
+
export { storageMount };
|
package/dist/core/unctx.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventStream
|
|
1
|
+
import { EventStream } from "./internal/event-stream.mjs";
|
|
2
2
|
import { SilgiEvent } from "silgi/types";
|
|
3
3
|
|
|
4
4
|
//#region src/core/utils/event-stream.d.ts
|
|
@@ -50,4 +50,4 @@ interface EventStreamMessage {
|
|
|
50
50
|
*/
|
|
51
51
|
declare function createEventStream(event: SilgiEvent, opts?: EventStreamOptions): EventStream;
|
|
52
52
|
//#endregion
|
|
53
|
-
export { EventStreamMessage, EventStreamOptions, createEventStream
|
|
53
|
+
export { EventStreamMessage, EventStreamOptions, createEventStream };
|
|
@@ -5,4 +5,4 @@ import { SilgiEvent, SilgiRuntimeContext } from "silgi/types";
|
|
|
5
5
|
declare function getEvent<T extends SilgiEvent>(event?: SilgiEvent): T;
|
|
6
6
|
declare function getEventContext<T extends SilgiRuntimeContext>(event?: SilgiEvent): T;
|
|
7
7
|
//#endregion
|
|
8
|
-
export { getEvent
|
|
8
|
+
export { getEvent, getEventContext };
|
|
@@ -11,4 +11,4 @@ declare function createMiddleware<S extends WildcardVariants<keyof Routers>, Use
|
|
|
11
11
|
path: Path;
|
|
12
12
|
}): CreateMiddlewareResult<Path, UsedMethod, Key>;
|
|
13
13
|
//#endregion
|
|
14
|
-
export { CreateMiddlewareResult, createMiddleware
|
|
14
|
+
export { CreateMiddlewareResult, createMiddleware };
|
|
@@ -4,4 +4,4 @@ import { Resolvers, SilgiURL } from "silgi/types";
|
|
|
4
4
|
declare function createResolver(resolver: Resolvers): Resolvers;
|
|
5
5
|
declare function getUrlPrefix(path: string, method?: string): SilgiURL;
|
|
6
6
|
//#endregion
|
|
7
|
-
export { createResolver
|
|
7
|
+
export { createResolver, getUrlPrefix };
|
|
@@ -10,4 +10,4 @@ declare function defineServiceSetup<Method extends HTTPMethod, Path extends keyo
|
|
|
10
10
|
declare function createService<Path extends string, Method extends HTTPMethod, Input extends StandardSchemaV1 = StandardSchemaV1, Output extends StandardSchemaV1 = StandardSchemaV1, PathParams extends StandardSchemaV1 | undefined | never = undefined, QueryParams extends StandardSchemaV1 | undefined | never = undefined, Resolved extends boolean = false, HiddenParameters extends boolean = false>(params: ServiceSetup<Method, Path, Input, Output, PathParams, QueryParams, Resolved, HiddenParameters>): Record<`http:${Method}:${Path}`, ServiceSetup<Method, Path, Input, Output, PathParams, QueryParams, Resolved, HiddenParameters>>;
|
|
11
11
|
declare function createWebSocket<Path extends string, Method extends HTTPMethod>(params: WebSocketServiceSetup<Method, Path>): Record<`websocket:${Method}:${Path}`, WebSocketServiceSetup<Method, Path>>;
|
|
12
12
|
//#endregion
|
|
13
|
-
export { createService
|
|
13
|
+
export { createService, createWebSocket, defineServiceSetup };
|
|
@@ -21,4 +21,4 @@ declare function createStorage$1(silgi: Silgi): Promise<Storage<StorageValue>>;
|
|
|
21
21
|
// }
|
|
22
22
|
declare function useSilgiStorage<T extends StorageValue = StorageValue>(base?: StorageConfig<T>["base"] | (string & {})): Storage<T>;
|
|
23
23
|
//#endregion
|
|
24
|
-
export { createStorage$1
|
|
24
|
+
export { createStorage$1 as createStorage, useSilgiStorage };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { updateRuntimeStorage
|
|
2
|
-
import { createSilgi
|
|
3
|
-
import { SilgiError
|
|
4
|
-
import { SilgiHttpEvent
|
|
5
|
-
import { handleResponse
|
|
6
|
-
import { getWebsocket
|
|
7
|
-
import { silgiCLICtx
|
|
8
|
-
import { storageMount
|
|
9
|
-
import { silgiCtx
|
|
10
|
-
import { createEventStream
|
|
11
|
-
import { getEvent
|
|
12
|
-
import { deepMergeObjects
|
|
13
|
-
import { createMiddleware
|
|
14
|
-
import { createResolver
|
|
15
|
-
import { replaceRuntimeValues
|
|
16
|
-
import { createSchema
|
|
17
|
-
import { createService
|
|
18
|
-
import { createShared
|
|
19
|
-
import { createStorage
|
|
1
|
+
import { updateRuntimeStorage, useRuntime } from "./core/context.mjs";
|
|
2
|
+
import { createSilgi } from "./core/createSilgi.mjs";
|
|
3
|
+
import { SilgiError, createError, isError } from "./core/error.mjs";
|
|
4
|
+
import { SilgiHttpEvent } from "./core/event.mjs";
|
|
5
|
+
import { handleResponse, kHandled, kNotFound } from "./core/response.mjs";
|
|
6
|
+
import { getWebsocket, handler, middleware, silgiFetch } from "./core/silgi.mjs";
|
|
7
|
+
import { silgiCLICtx, tryUseSilgiCLI, useSilgiCLI } from "./core/silgiApp.mjs";
|
|
8
|
+
import { storageMount } from "./core/storage.mjs";
|
|
9
|
+
import { silgiCtx, tryUseSilgi, useSilgi } from "./core/unctx.mjs";
|
|
10
|
+
import { createEventStream } from "./core/utils/event-stream.mjs";
|
|
11
|
+
import { getEvent, getEventContext } from "./core/utils/event.mjs";
|
|
12
|
+
import { deepMergeObjects } from "./core/utils/merge.mjs";
|
|
13
|
+
import { createMiddleware } from "./core/utils/middleware.mjs";
|
|
14
|
+
import { createResolver, getUrlPrefix } from "./core/utils/resolver.mjs";
|
|
15
|
+
import { replaceRuntimeValues } from "./core/utils/runtime.mjs";
|
|
16
|
+
import { createSchema } from "./core/utils/schema.mjs";
|
|
17
|
+
import { createService, createWebSocket, defineServiceSetup } from "./core/utils/service.mjs";
|
|
18
|
+
import { createShared } from "./core/utils/shared.mjs";
|
|
19
|
+
import { createStorage, useSilgiStorage } from "./core/utils/storage.mjs";
|
|
20
20
|
import { autoImportTypes } from "./core/index.mjs";
|
|
21
21
|
export { SilgiError, SilgiHttpEvent, autoImportTypes, createError, createEventStream, createMiddleware, createResolver, createSchema, createService, createShared, createSilgi, createStorage, createWebSocket, deepMergeObjects, defineServiceSetup, getEvent, getEventContext, getUrlPrefix, getWebsocket, handleResponse, handler, isError, kHandled, kNotFound, middleware, replaceRuntimeValues, silgiCLICtx, silgiCtx, silgiFetch, storageMount, tryUseSilgi, tryUseSilgiCLI, updateRuntimeStorage, useRuntime, useSilgi, useSilgiCLI, useSilgiStorage };
|
package/dist/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { createStorage, useSilgiStorage } from "./core/utils/storage.mjs";
|
|
|
7
7
|
import { createSilgi } from "./core/createSilgi.mjs";
|
|
8
8
|
import { SilgiHttpEvent } from "./core/event.mjs";
|
|
9
9
|
import { handleResponse, kHandled, kNotFound } from "./core/response.mjs";
|
|
10
|
-
import { createResolver
|
|
10
|
+
import { createResolver, getUrlPrefix } from "./core/utils/resolver.mjs";
|
|
11
11
|
import { getWebsocket, handler, middleware, silgiFetch } from "./core/silgi.mjs";
|
|
12
12
|
import { storageMount } from "./core/storage.mjs";
|
|
13
13
|
import { createEventStream } from "./core/utils/event-stream.mjs";
|
package/dist/kit/define.d.mts
CHANGED
|
@@ -25,4 +25,4 @@ declare function defineFramework<T extends PresetName>(preset: T): {
|
|
|
25
25
|
build(callback: (options: DefineFrameworkOptions<T>) => void | Promise<void>): (options: DefineFrameworkOptions<T>) => Promise<void>;
|
|
26
26
|
};
|
|
27
27
|
//#endregion
|
|
28
|
-
export { defineFramework
|
|
28
|
+
export { defineFramework };
|
package/dist/kit/errors.d.mts
CHANGED
package/dist/kit/esm.d.mts
CHANGED
|
@@ -8,4 +8,4 @@ declare function directoryToURL(dir: string): URL;
|
|
|
8
8
|
*/
|
|
9
9
|
declare function tryResolveModule(id: string, url?: string | string[]): Promise<string | undefined>;
|
|
10
10
|
//#endregion
|
|
11
|
-
export { directoryToURL
|
|
11
|
+
export { directoryToURL, tryResolveModule };
|
package/dist/kit/fs.d.mts
CHANGED
|
@@ -4,4 +4,4 @@ import { Buffer } from "node:buffer";
|
|
|
4
4
|
declare function writeFile(file: string, contents: Buffer | string, log?: boolean): Promise<void>;
|
|
5
5
|
declare function isDirectory(path: string): Promise<boolean>;
|
|
6
6
|
//#endregion
|
|
7
|
-
export { isDirectory
|
|
7
|
+
export { isDirectory, writeFile };
|
|
@@ -24,4 +24,4 @@ declare function createFunction(name: string, args?: any): FunctionConfig;
|
|
|
24
24
|
*/
|
|
25
25
|
declare function formatFunctions(configs: FunctionConfig[], indentation?: number, specialVars?: string[], deduplicateArgs?: boolean): string;
|
|
26
26
|
//#endregion
|
|
27
|
-
export { FunctionConfig, createFunction
|
|
27
|
+
export { FunctionConfig, createFunction, createFunctionConfigs, formatFunctions };
|
|
@@ -24,7 +24,7 @@ function createFunction(name, args = {}) {
|
|
|
24
24
|
*/
|
|
25
25
|
function formatFunctions(configs, indentation = 4, specialVars = [], deduplicateArgs = false) {
|
|
26
26
|
const indent = " ".repeat(indentation);
|
|
27
|
-
const argMap = new Map();
|
|
27
|
+
const argMap = /* @__PURE__ */ new Map();
|
|
28
28
|
const argVarDeclarations = [];
|
|
29
29
|
let argCounter = 0;
|
|
30
30
|
if (deduplicateArgs) configs.forEach((config) => {
|
package/dist/kit/gen.d.mts
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
declare function genEnsureSafeVar(name: string | any): string;
|
|
3
3
|
declare function getAllEntries(obj: object): [string, any][];
|
|
4
4
|
//#endregion
|
|
5
|
-
export { genEnsureSafeVar
|
|
5
|
+
export { genEnsureSafeVar, getAllEntries };
|
package/dist/kit/hash.d.mts
CHANGED
package/dist/kit/index.d.mts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { addCommands
|
|
2
|
-
import { addCoreFile
|
|
3
|
-
import { addImports
|
|
4
|
-
import { addNPMPackage
|
|
5
|
-
import { defineFramework
|
|
6
|
-
import { hasError
|
|
7
|
-
import { directoryToURL
|
|
8
|
-
import { isDirectory
|
|
9
|
-
import { FunctionConfig, createFunction
|
|
10
|
-
import { genEnsureSafeVar
|
|
11
|
-
import { hash
|
|
12
|
-
import { isH3
|
|
13
|
-
import { useLogger
|
|
14
|
-
import { JsonPatch, MigrationData, MigrationInfo, MigrationOptions, MigrationResult, MigrationStatus
|
|
15
|
-
import { defineSilgiModule
|
|
16
|
-
import { prettyPath
|
|
17
|
-
import { defineSilgiPreset
|
|
18
|
-
import { createResolver
|
|
19
|
-
import { addTemplate
|
|
20
|
-
import { getIpAddress
|
|
21
|
-
import { MODE_RE
|
|
1
|
+
import { addCommands } from "./add/add-commands.mjs";
|
|
2
|
+
import { addCoreFile } from "./add/add-core-file.mjs";
|
|
3
|
+
import { addImports } from "./add/add-imports.mjs";
|
|
4
|
+
import { addNPMPackage } from "./add/add-npm.mjs";
|
|
5
|
+
import { defineFramework } from "./define.mjs";
|
|
6
|
+
import { hasError } from "./errors.mjs";
|
|
7
|
+
import { directoryToURL, tryResolveModule } from "./esm.mjs";
|
|
8
|
+
import { isDirectory, writeFile } from "./fs.mjs";
|
|
9
|
+
import { FunctionConfig, createFunction, createFunctionConfigs, formatFunctions } from "./function-utils.mjs";
|
|
10
|
+
import { genEnsureSafeVar, getAllEntries } from "./gen.mjs";
|
|
11
|
+
import { hash } from "./hash.mjs";
|
|
12
|
+
import { isH3, isNitro, isNuxt } from "./isFramework.mjs";
|
|
13
|
+
import { useLogger } from "./logger.mjs";
|
|
14
|
+
import { JsonPatch, MigrationData, MigrationInfo, MigrationOptions, MigrationResult, MigrationStatus, generateMigration, getMigration, listMigrations, migrationDown, migrationUp } from "./migration.mjs";
|
|
15
|
+
import { defineSilgiModule } from "./module.mjs";
|
|
16
|
+
import { prettyPath, resolveSilgiPath } from "./path.mjs";
|
|
17
|
+
import { defineSilgiPreset } from "./preset.mjs";
|
|
18
|
+
import { createResolver, resolveAlias, resolvePath, resolveSilgiModule } from "./resolve.mjs";
|
|
19
|
+
import { addTemplate, normalizeTemplate } from "./template.mjs";
|
|
20
|
+
import { getIpAddress, useRequest } from "./useRequest.mjs";
|
|
21
|
+
import { MODE_RE, baseHeaderBannerComment, filterInPlace, getServicePath, hasInstalledModule, hasSilgiModule, isPresents, isRuntimePresents, processFilePath, relativeWithDot, removeExtension, toArray } from "./utils.mjs";
|
|
22
22
|
export { FunctionConfig, JsonPatch, MODE_RE, MigrationData, MigrationInfo, MigrationOptions, MigrationResult, MigrationStatus, addCommands, addCoreFile, addImports, addNPMPackage, addTemplate, baseHeaderBannerComment, createFunction, createFunctionConfigs, createResolver, defineFramework, defineSilgiModule, defineSilgiPreset, directoryToURL, filterInPlace, formatFunctions, genEnsureSafeVar, generateMigration, getAllEntries, getIpAddress, getMigration, getServicePath, hasError, hasInstalledModule, hasSilgiModule, hash, isDirectory, isH3, isNitro, isNuxt, isPresents, isRuntimePresents, listMigrations, migrationDown, migrationUp, normalizeTemplate, prettyPath, processFilePath, relativeWithDot, removeExtension, resolveAlias, resolvePath, resolveSilgiModule, resolveSilgiPath, toArray, tryResolveModule, useLogger, useRequest, writeFile };
|
package/dist/kit/logger.d.mts
CHANGED
package/dist/kit/migration.d.mts
CHANGED
|
@@ -110,4 +110,4 @@ declare function migrationUp(migrationsDir: string, targetTimestamp?: number): P
|
|
|
110
110
|
*/
|
|
111
111
|
declare function migrationDown(migrationsDir: string, targetTimestamp?: number): Promise<MigrationResult>;
|
|
112
112
|
//#endregion
|
|
113
|
-
export { JsonPatch, MigrationData, MigrationInfo, MigrationOptions, MigrationResult, MigrationStatus
|
|
113
|
+
export { JsonPatch, MigrationData, MigrationInfo, MigrationOptions, MigrationResult, MigrationStatus, generateMigration, getMigration, listMigrations, migrationDown, migrationUp };
|
package/dist/kit/migration.mjs
CHANGED
|
@@ -79,7 +79,7 @@ async function generateMigration(data, directoryPath, fileNamePrefix = "data_",
|
|
|
79
79
|
const latestInfo = {
|
|
80
80
|
timestamp,
|
|
81
81
|
file: fileName,
|
|
82
|
-
created: new Date().toISOString(),
|
|
82
|
+
created: (/* @__PURE__ */ new Date()).toISOString(),
|
|
83
83
|
description,
|
|
84
84
|
isPatch
|
|
85
85
|
};
|
package/dist/kit/module.d.mts
CHANGED
|
@@ -11,4 +11,4 @@ declare function defineSilgiModule<TOptions extends ModuleOptionsCustom>(): {
|
|
|
11
11
|
with: <TOptionsDefaults extends Partial<TOptions>>(definition: ModuleDefinition<TOptions, TOptionsDefaults, true> | SilgiModule<TOptions, TOptionsDefaults, true>) => SilgiModule<TOptions, TOptionsDefaults, true>;
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
14
|
-
export { defineSilgiModule
|
|
14
|
+
export { defineSilgiModule };
|
package/dist/kit/path.d.mts
CHANGED
|
@@ -4,4 +4,4 @@ import { SilgiCLI } from "silgi/types";
|
|
|
4
4
|
declare function prettyPath(p: string, highlight?: boolean): string;
|
|
5
5
|
declare function resolveSilgiPath(path: string, silgiCLIOptions: SilgiCLI["options"], base?: string): string;
|
|
6
6
|
//#endregion
|
|
7
|
-
export { prettyPath
|
|
7
|
+
export { prettyPath, resolveSilgiPath };
|
package/dist/kit/preset.d.mts
CHANGED
package/dist/kit/resolve.d.mts
CHANGED
|
@@ -34,4 +34,4 @@ interface Resolver {
|
|
|
34
34
|
declare function createResolver(base: string | URL): Resolver;
|
|
35
35
|
declare function resolveSilgiModule(base: string, paths: string[]): Promise<string[]>;
|
|
36
36
|
//#endregion
|
|
37
|
-
export { createResolver
|
|
37
|
+
export { createResolver, resolveAlias, resolvePath, resolveSilgiModule };
|
package/dist/kit/template.d.mts
CHANGED
|
@@ -11,4 +11,4 @@ declare function addTemplate<T>(_template: SilgiTemplate<T> | string): ResolvedS
|
|
|
11
11
|
*/
|
|
12
12
|
declare function normalizeTemplate<T>(template: SilgiTemplate<T> | string, buildDir?: string): ResolvedSilgiTemplate<T>;
|
|
13
13
|
//#endregion
|
|
14
|
-
export { addTemplate
|
|
14
|
+
export { addTemplate, normalizeTemplate };
|
|
@@ -16,4 +16,4 @@ declare function useRequest<T extends IncomingMessage>(event: SilgiEvent): T | (
|
|
|
16
16
|
*/
|
|
17
17
|
declare function getIpAddress(req: Request): string;
|
|
18
18
|
//#endregion
|
|
19
|
-
export { getIpAddress
|
|
19
|
+
export { getIpAddress, useRequest };
|
package/dist/kit/utils.d.mts
CHANGED
|
@@ -31,4 +31,4 @@ declare function getServicePath(_route: string): {
|
|
|
31
31
|
route: string;
|
|
32
32
|
};
|
|
33
33
|
//#endregion
|
|
34
|
-
export { MODE_RE
|
|
34
|
+
export { MODE_RE, baseHeaderBannerComment, filterInPlace, getServicePath, hasInstalledModule, hasSilgiModule, isPresents, isRuntimePresents, processFilePath, relativeWithDot, removeExtension, toArray };
|
package/dist/package.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
//#region package.json
|
|
2
2
|
var name = "silgi";
|
|
3
3
|
var type = "module";
|
|
4
|
-
var version = "0.43.
|
|
4
|
+
var version = "0.43.9";
|
|
5
5
|
var private$1 = false;
|
|
6
|
-
var packageManager = "pnpm@10.
|
|
6
|
+
var packageManager = "pnpm@10.12.2";
|
|
7
7
|
var sideEffects = false;
|
|
8
8
|
var exports = {
|
|
9
9
|
"./package.json": "./package.json",
|
|
@@ -77,7 +77,7 @@ var dependencies = {
|
|
|
77
77
|
"@fastify/deepmerge": "catalog:",
|
|
78
78
|
"@graphql-tools/utils": "^10.8.6",
|
|
79
79
|
"@standard-community/standard-json": "^0.2.0",
|
|
80
|
-
"apiful": "^3.
|
|
80
|
+
"apiful": "^3.4.0",
|
|
81
81
|
"c12": "catalog:",
|
|
82
82
|
"chokidar": "catalog:",
|
|
83
83
|
"citty": "catalog:",
|
|
@@ -90,7 +90,7 @@ var dependencies = {
|
|
|
90
90
|
"dot-prop": "catalog:",
|
|
91
91
|
"dotenv": "catalog:",
|
|
92
92
|
"escape-string-regexp": "catalog:",
|
|
93
|
-
"exsolve": "^1.0.
|
|
93
|
+
"exsolve": "^1.0.7",
|
|
94
94
|
"graphql": "^16.11.0",
|
|
95
95
|
"hookable": "catalog:",
|
|
96
96
|
"ignore": "catalog:",
|
|
@@ -101,19 +101,20 @@ var dependencies = {
|
|
|
101
101
|
"mlly": "catalog:",
|
|
102
102
|
"ofetch": "catalog:",
|
|
103
103
|
"ohash": "catalog:",
|
|
104
|
-
"oxc-parser": "^0.
|
|
104
|
+
"oxc-parser": "^0.74.0",
|
|
105
105
|
"pathe": "catalog:",
|
|
106
106
|
"perfect-debounce": "^1.0.0",
|
|
107
107
|
"picocolors": "catalog:",
|
|
108
108
|
"pkg-types": "catalog:",
|
|
109
109
|
"rfc6902": "^5.1.2",
|
|
110
|
-
"rou3": "^0.
|
|
110
|
+
"rou3": "^0.7.2",
|
|
111
111
|
"scule": "catalog:",
|
|
112
112
|
"semver": "catalog:",
|
|
113
|
-
"srvx": "^0.
|
|
113
|
+
"srvx": "^0.8.0",
|
|
114
114
|
"std-env": "catalog:",
|
|
115
115
|
"tinyexec": "^1.0.1",
|
|
116
116
|
"tinyglobby": "^0.2.14",
|
|
117
|
+
"tree-kill": "^1.2.2",
|
|
117
118
|
"ufo": "catalog:",
|
|
118
119
|
"unadapter": "^0.1.2",
|
|
119
120
|
"unctx": "catalog:",
|
|
@@ -131,10 +132,10 @@ var devDependencies = {
|
|
|
131
132
|
"@types/semver": "catalog:",
|
|
132
133
|
"@vitest/coverage-v8": "catalog:",
|
|
133
134
|
"eslint": "catalog:",
|
|
134
|
-
"h3": "
|
|
135
|
+
"h3": "^2.0.0-beta.0",
|
|
135
136
|
"nitropack": "catalog:",
|
|
136
137
|
"nuxt": "catalog:",
|
|
137
|
-
"tsdown": "^0.12.
|
|
138
|
+
"tsdown": "^0.12.8",
|
|
138
139
|
"typescript": "catalog:",
|
|
139
140
|
"vitest": "catalog:",
|
|
140
141
|
"vue": "catalog:",
|
|
@@ -173,4 +174,4 @@ var package_default = {
|
|
|
173
174
|
};
|
|
174
175
|
|
|
175
176
|
//#endregion
|
|
176
|
-
export { package_default };
|
|
177
|
+
export { package_default as default };
|
package/dist/types/kits.d.mts
CHANGED
|
@@ -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
|
|
4
|
+
import * as h33 from "h3";
|
|
5
5
|
import { PresetName } from "silgi/presets";
|
|
6
|
-
import * as
|
|
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" ?
|
|
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
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/types/tree-kill.d.ts
|
|
2
|
+
declare module "tree-kill" {
|
|
3
|
+
type Callback = (error?: Error) => void;
|
|
4
|
+
/**
|
|
5
|
+
* Kills the process with the given `pid` and all its children.
|
|
6
|
+
* @param pid Process ID to kill
|
|
7
|
+
* @param signal Signal to send (default: 'SIGTERM')
|
|
8
|
+
* @param callback Callback function (optional)
|
|
9
|
+
*/
|
|
10
|
+
function treeKill(pid: number, signal?: NodeJS.Signals | number | string, callback?: Callback): void;
|
|
11
|
+
/**
|
|
12
|
+
* Kills the process with the given `pid` and all its children.
|
|
13
|
+
* @param pid Process ID to kill
|
|
14
|
+
* @param callback Callback function
|
|
15
|
+
*/
|
|
16
|
+
function treeKill(pid: number, callback: Callback): void;
|
|
17
|
+
export default treeKill;
|
|
18
|
+
}
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "silgi",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.43.
|
|
4
|
+
"version": "0.43.9",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"exports": {
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"@fastify/deepmerge": "^3.1.0",
|
|
87
87
|
"@graphql-tools/utils": "^10.8.6",
|
|
88
88
|
"@standard-community/standard-json": "^0.2.0",
|
|
89
|
-
"apiful": "^3.
|
|
89
|
+
"apiful": "^3.4.0",
|
|
90
90
|
"c12": "^3.0.4",
|
|
91
91
|
"chokidar": "^4.0.3",
|
|
92
92
|
"citty": "^0.1.6",
|
|
@@ -99,10 +99,10 @@
|
|
|
99
99
|
"dot-prop": "^9.0.0",
|
|
100
100
|
"dotenv": "^16.5.0",
|
|
101
101
|
"escape-string-regexp": "^5.0.0",
|
|
102
|
-
"exsolve": "^1.0.
|
|
102
|
+
"exsolve": "^1.0.7",
|
|
103
103
|
"graphql": "^16.11.0",
|
|
104
104
|
"hookable": "^5.5.3",
|
|
105
|
-
"ignore": "^7.0.
|
|
105
|
+
"ignore": "^7.0.5",
|
|
106
106
|
"klona": "^2.0.6",
|
|
107
107
|
"knitwork": "^1.2.0",
|
|
108
108
|
"magicast": "^0.3.5",
|
|
@@ -110,19 +110,20 @@
|
|
|
110
110
|
"mlly": "^1.7.4",
|
|
111
111
|
"ofetch": "^1.4.1",
|
|
112
112
|
"ohash": "^2.0.11",
|
|
113
|
-
"oxc-parser": "^0.
|
|
113
|
+
"oxc-parser": "^0.74.0",
|
|
114
114
|
"pathe": "^2.0.3",
|
|
115
115
|
"perfect-debounce": "^1.0.0",
|
|
116
116
|
"picocolors": "^1.1.1",
|
|
117
117
|
"pkg-types": "^2.1.0",
|
|
118
118
|
"rfc6902": "^5.1.2",
|
|
119
|
-
"rou3": "^0.
|
|
119
|
+
"rou3": "^0.7.2",
|
|
120
120
|
"scule": "^1.3.0",
|
|
121
121
|
"semver": "^7.7.2",
|
|
122
|
-
"srvx": "^0.
|
|
122
|
+
"srvx": "^0.8.0",
|
|
123
123
|
"std-env": "^3.9.0",
|
|
124
124
|
"tinyexec": "^1.0.1",
|
|
125
125
|
"tinyglobby": "^0.2.14",
|
|
126
|
+
"tree-kill": "^1.2.2",
|
|
126
127
|
"ufo": "^1.6.1",
|
|
127
128
|
"unadapter": "^0.1.2",
|
|
128
129
|
"unctx": "^2.4.1",
|
|
@@ -131,23 +132,23 @@
|
|
|
131
132
|
"untyped": "^2.0.0"
|
|
132
133
|
},
|
|
133
134
|
"devDependencies": {
|
|
134
|
-
"@antfu/eslint-config": "^4.
|
|
135
|
-
"@nuxt/kit": "^3.17.
|
|
136
|
-
"@nuxt/schema": "^3.17.
|
|
135
|
+
"@antfu/eslint-config": "^4.16.1",
|
|
136
|
+
"@nuxt/kit": "^3.17.5",
|
|
137
|
+
"@nuxt/schema": "^3.17.5",
|
|
137
138
|
"@silgi/ecosystem": "^0.7.2",
|
|
138
139
|
"@types/micromatch": "^4.0.9",
|
|
139
|
-
"@types/node": "^
|
|
140
|
+
"@types/node": "^24.0.3",
|
|
140
141
|
"@types/semver": "^7.7.0",
|
|
141
142
|
"@vitest/coverage-v8": "3.0.5",
|
|
142
|
-
"eslint": "^9.
|
|
143
|
-
"h3": "^
|
|
143
|
+
"eslint": "^9.29.0",
|
|
144
|
+
"h3": "^2.0.0-beta.0",
|
|
144
145
|
"nitropack": "^2.11.12",
|
|
145
|
-
"nuxt": "^3.17.
|
|
146
|
-
"tsdown": "^0.12.
|
|
146
|
+
"nuxt": "^3.17.5",
|
|
147
|
+
"tsdown": "^0.12.8",
|
|
147
148
|
"typescript": "^5.8.3",
|
|
148
|
-
"vitest": "^3.
|
|
149
|
-
"vue": "^3.5.
|
|
150
|
-
"zod": "^3.25.
|
|
149
|
+
"vitest": "^3.2.4",
|
|
150
|
+
"vue": "^3.5.17",
|
|
151
|
+
"zod": "^3.25.67"
|
|
151
152
|
},
|
|
152
153
|
"resolutions": {
|
|
153
154
|
"silgi": "link:."
|