silgi 0.43.0 → 0.43.1
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/cli/scan/scanExportFile.mjs +35 -0
- package/dist/core/index.mjs +1 -1
- package/dist/core/utils/resolver.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/kit/index.mjs +1 -1
- package/dist/kit/resolve.mjs +1 -1
- package/dist/package.mjs +2 -2
- package/package.json +4 -4
|
@@ -202,6 +202,15 @@ async function extractExportEntitiesFromFile(absoluteFilePath, functionExportNam
|
|
|
202
202
|
const exportEntities = [];
|
|
203
203
|
const fileContent = await readFile(absoluteFilePath, "utf-8");
|
|
204
204
|
const parsed = await parseAsync(absoluteFilePath, fileContent);
|
|
205
|
+
const variableDeclarations = new Map();
|
|
206
|
+
for (const node of parsed.program.body) {
|
|
207
|
+
if (node.type === "VariableDeclaration" && Array.isArray(node.declarations)) {
|
|
208
|
+
for (const decl of node.declarations) if (decl.type === "VariableDeclarator" && decl.id.type === "Identifier") variableDeclarations.set(decl.id.name, decl);
|
|
209
|
+
}
|
|
210
|
+
if (node.type === "ExportNamedDeclaration" && node.declaration && node.declaration.type === "VariableDeclaration") {
|
|
211
|
+
for (const decl of node.declaration.declarations) if (decl.type === "VariableDeclarator" && decl.id.type === "Identifier") variableDeclarations.set(decl.id.name, decl);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
205
214
|
for (const node of parsed.program.body) if (node.type === "ExportNamedDeclaration" && node.declaration && node.declaration.type === "TSInterfaceDeclaration") {
|
|
206
215
|
const decl = node.declaration;
|
|
207
216
|
if (Array.isArray(decl.extends) && decl.extends.some((dec) => dec.type === "TSInterfaceHeritage" && dec.expression.type === "Identifier" && interfaceExtendsNames.includes(dec.expression.name))) exportEntities.push({
|
|
@@ -236,6 +245,32 @@ async function extractExportEntitiesFromFile(absoluteFilePath, functionExportNam
|
|
|
236
245
|
}
|
|
237
246
|
}
|
|
238
247
|
}
|
|
248
|
+
for (const node of parsed.program.body) if (node.type === "ExportNamedDeclaration" && Array.isArray(node.specifiers) && node.specifiers.length > 0) {
|
|
249
|
+
for (const spec of node.specifiers) if (spec.type === "ExportSpecifier" && spec.local.type === "Identifier") {
|
|
250
|
+
const varName = spec.local.name;
|
|
251
|
+
const decl = variableDeclarations.get(varName);
|
|
252
|
+
if (decl && decl.init && decl.init.type === "CallExpression" && decl.init.callee.type === "Identifier" && functionExportNames.includes(decl.init.callee.name)) {
|
|
253
|
+
let servicePath;
|
|
254
|
+
let serviceMethod;
|
|
255
|
+
if (decl.init.callee.name === "createService" || decl.init.callee.name === "createWebSocket") {
|
|
256
|
+
const firstArg = decl.init.arguments?.[0];
|
|
257
|
+
if (firstArg && firstArg.type === "ObjectExpression" && Array.isArray(firstArg.properties)) {
|
|
258
|
+
for (const prop of firstArg.properties) if (prop.type === "Property" && prop.key.type === "Identifier") {
|
|
259
|
+
if (prop.key.name === "path" && prop.value.type === "Literal" && typeof prop.value.value === "string") servicePath = prop.value.value;
|
|
260
|
+
if (prop.key.name === "method" && prop.value.type === "Literal" && typeof prop.value.value === "string") serviceMethod = prop.value.value;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
exportEntities.push({
|
|
265
|
+
name: varName,
|
|
266
|
+
type: "function",
|
|
267
|
+
funcName: decl.init.callee.name,
|
|
268
|
+
servicePath,
|
|
269
|
+
serviceMethod
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
239
274
|
return exportEntities;
|
|
240
275
|
}
|
|
241
276
|
/**
|
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/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/index.mjs
CHANGED
|
@@ -16,7 +16,7 @@ import { useLogger } from "./logger.mjs";
|
|
|
16
16
|
import { MigrationStatus, generateMigration, getMigration, listMigrations, migrationDown, migrationUp } from "./migration.mjs";
|
|
17
17
|
import { defineSilgiModule } from "./module.mjs";
|
|
18
18
|
import { defineSilgiPreset } from "./preset.mjs";
|
|
19
|
-
import { createResolver, resolveAlias, resolvePath, resolveSilgiModule } from "./resolve.mjs";
|
|
19
|
+
import { createResolver$1 as createResolver, resolveAlias, resolvePath, resolveSilgiModule } from "./resolve.mjs";
|
|
20
20
|
import { addTemplate, normalizeTemplate } from "./template.mjs";
|
|
21
21
|
import { getIpAddress, useRequest } from "./useRequest.mjs";
|
|
22
22
|
|
package/dist/kit/resolve.mjs
CHANGED
|
@@ -79,4 +79,4 @@ async function resolveSilgiModule(base, paths) {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
//#endregion
|
|
82
|
-
export { createResolver, resolveAlias$1 as resolveAlias, resolvePath$1 as resolvePath, resolveSilgiModule };
|
|
82
|
+
export { createResolver as createResolver$1, resolveAlias$1 as resolveAlias, resolvePath$1 as resolvePath, resolveSilgiModule };
|
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.
|
|
4
|
+
var version = "0.43.1";
|
|
5
5
|
var private$1 = false;
|
|
6
6
|
var packageManager = "pnpm@10.11.0";
|
|
7
7
|
var sideEffects = false;
|
|
@@ -101,7 +101,7 @@ var dependencies = {
|
|
|
101
101
|
"mlly": "catalog:",
|
|
102
102
|
"ofetch": "catalog:",
|
|
103
103
|
"ohash": "catalog:",
|
|
104
|
-
"oxc-parser": "^0.72.
|
|
104
|
+
"oxc-parser": "^0.72.1",
|
|
105
105
|
"pathe": "catalog:",
|
|
106
106
|
"perfect-debounce": "^1.0.0",
|
|
107
107
|
"picocolors": "catalog:",
|
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.1",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"exports": {
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"mlly": "^1.7.4",
|
|
111
111
|
"ofetch": "^1.4.1",
|
|
112
112
|
"ohash": "^2.0.11",
|
|
113
|
-
"oxc-parser": "^0.72.
|
|
113
|
+
"oxc-parser": "^0.72.1",
|
|
114
114
|
"pathe": "^2.0.3",
|
|
115
115
|
"perfect-debounce": "^1.0.0",
|
|
116
116
|
"picocolors": "^1.1.1",
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
"@nuxt/schema": "^3.17.4",
|
|
137
137
|
"@silgi/ecosystem": "^0.7.2",
|
|
138
138
|
"@types/micromatch": "^4.0.9",
|
|
139
|
-
"@types/node": "^22.15.
|
|
139
|
+
"@types/node": "^22.15.23",
|
|
140
140
|
"@types/semver": "^7.7.0",
|
|
141
141
|
"@vitest/coverage-v8": "3.0.5",
|
|
142
142
|
"eslint": "^9.27.0",
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
"typescript": "^5.8.3",
|
|
148
148
|
"vitest": "^3.1.4",
|
|
149
149
|
"vue": "^3.5.15",
|
|
150
|
-
"zod": "^3.25.
|
|
150
|
+
"zod": "^3.25.32"
|
|
151
151
|
},
|
|
152
152
|
"resolutions": {
|
|
153
153
|
"silgi": "link:."
|