silgi 0.0.11 → 0.0.13
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/chunks/generate.mjs
CHANGED
|
@@ -74,6 +74,7 @@ async function generateClientGenTS(storage, outputDir) {
|
|
|
74
74
|
/* prettier-ignore */
|
|
75
75
|
/* silgi - productdevbook.com */
|
|
76
76
|
import type { ResultOf, VariablesOf } from 'gql.tada'
|
|
77
|
+
import type { z as Zod } from 'zod'
|
|
77
78
|
${imports.join("\n")}
|
|
78
79
|
|
|
79
80
|
export interface SilgiClientStore {
|
|
@@ -398,13 +399,13 @@ ${zodInterfacesImports.join("\n")}
|
|
|
398
399
|
${importsString.join("\n")}
|
|
399
400
|
|
|
400
401
|
declare module 'silgi' {
|
|
401
|
-
type SharedGlobalMerge =
|
|
402
|
+
type SharedGlobalMerge = ${scopeDatas.some((scope) => scope.context.length > 0) ? `${scopeDatas.filter((scope) => scope.shareds.length > 0).map((scopeData) => {
|
|
402
403
|
return scopeData.shareds.map((shared) => {
|
|
403
404
|
if (shared.global) {
|
|
404
405
|
return shared.value;
|
|
405
406
|
}
|
|
406
407
|
}).filter(Boolean).join(" & ");
|
|
407
|
-
}).filter(Boolean).join(" & ")}` : ""}
|
|
408
|
+
}).filter(Boolean).join(" & ")}` : "{}"}
|
|
408
409
|
|
|
409
410
|
interface DefaultInterface {
|
|
410
411
|
${scopeDatas.some((scope) => scope.services.length > 0) ? `scopes: {
|
|
@@ -454,7 +455,7 @@ declare module 'silgi' {
|
|
|
454
455
|
return shared.value;
|
|
455
456
|
}
|
|
456
457
|
}).filter(Boolean).join(" & ");
|
|
457
|
-
}).filter(Boolean).reduce((acc, curr) => acc ? `${acc} & ${curr}` : curr, "") : ""}
|
|
458
|
+
}).filter(Boolean).reduce((acc, curr) => acc ? `${acc} & ${curr}` : curr, "") : "{}"}
|
|
458
459
|
|
|
459
460
|
interface DefaultContext extends ExtendDefaultContext {}
|
|
460
461
|
}
|
package/dist/cli/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import consola from 'consola';
|
|
|
3
3
|
|
|
4
4
|
const name = "silgi";
|
|
5
5
|
const type = "module";
|
|
6
|
-
const version = "0.0.
|
|
6
|
+
const version = "0.0.13";
|
|
7
7
|
const exports = {
|
|
8
8
|
".": {
|
|
9
9
|
"import": {
|
|
@@ -54,7 +54,7 @@ const scripts = {
|
|
|
54
54
|
};
|
|
55
55
|
const dependencies = {
|
|
56
56
|
"@anatine/zod-openapi": "^2.2.6",
|
|
57
|
-
"@antfu/eslint-config": "^3.12.
|
|
57
|
+
"@antfu/eslint-config": "^3.12.2",
|
|
58
58
|
"@asteasolutions/zod-to-openapi": "^7.3.0",
|
|
59
59
|
"@oxc-parser/wasm": "^0.44.0",
|
|
60
60
|
c12: "^2.0.1",
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { c as createSilgi, d as defineService, a as defineSilgiPlugin, s as silgiCtx, e as useHook, u as useShared, b as useSilgi } from './shared/silgi.
|
|
1
|
+
export { c as createSilgi, d as defineService, a as defineSilgiPlugin, s as silgiCtx, e as useHook, u as useShared, b as useSilgi } from './shared/silgi.BMCYk2cR.mjs';
|
|
2
2
|
import 'consola';
|
|
3
3
|
import 'hookable';
|
|
4
4
|
import 'node:buffer';
|
package/dist/plugins/openapi.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { mkdir, writeFile } from 'node:fs/promises';
|
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { generateSchema } from '@anatine/zod-openapi';
|
|
4
4
|
import consola from 'consola';
|
|
5
|
-
import { a as defineSilgiPlugin } from '../shared/silgi.
|
|
5
|
+
import { a as defineSilgiPlugin } from '../shared/silgi.BMCYk2cR.mjs';
|
|
6
6
|
import 'hookable';
|
|
7
7
|
import 'node:buffer';
|
|
8
8
|
import 'node:fs';
|
|
@@ -96,8 +96,8 @@ const createOpenAPIPlugin = defineSilgiPlugin({
|
|
|
96
96
|
name: paramName,
|
|
97
97
|
required: schema.input?.required?.includes(paramName) || false,
|
|
98
98
|
schema: paramSchema,
|
|
99
|
-
description: paramSchema.description ||
|
|
100
|
-
$ref: paramSchema.$ref ||
|
|
99
|
+
description: paramSchema.description || undefined,
|
|
100
|
+
$ref: paramSchema.$ref || undefined
|
|
101
101
|
}));
|
|
102
102
|
case "delete":
|
|
103
103
|
return [{
|
package/dist/plugins/scalar.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { mkdir, writeFile } from 'node:fs/promises';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { defineEventHandler } from 'h3';
|
|
4
|
-
import { a as defineSilgiPlugin } from '../shared/silgi.
|
|
4
|
+
import { a as defineSilgiPlugin } from '../shared/silgi.BMCYk2cR.mjs';
|
|
5
5
|
import 'consola';
|
|
6
6
|
import 'hookable';
|
|
7
7
|
import 'node:buffer';
|
|
@@ -48,7 +48,7 @@ Details: ${JSON.stringify(this.details, null, 2)}`;
|
|
|
48
48
|
return new PergelError({
|
|
49
49
|
code,
|
|
50
50
|
message: error instanceof Error ? error.message : String(error),
|
|
51
|
-
cause: error instanceof Error ? error :
|
|
51
|
+
cause: error instanceof Error ? error : undefined
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
static isPergelError(error) {
|
|
@@ -259,7 +259,7 @@ class PluginManager {
|
|
|
259
259
|
throw new PergelError({
|
|
260
260
|
code: "PLUGIN_SETUP_ERROR",
|
|
261
261
|
message: `Failed to setup plugin ${String(plugin.name)}`,
|
|
262
|
-
cause: error instanceof Error ? error :
|
|
262
|
+
cause: error instanceof Error ? error : undefined
|
|
263
263
|
});
|
|
264
264
|
}
|
|
265
265
|
}
|
|
@@ -269,8 +269,8 @@ class PluginManager {
|
|
|
269
269
|
...context
|
|
270
270
|
};
|
|
271
271
|
this.log(`Running hook: ${String(hookName)}`, {
|
|
272
|
-
scope: context?.scope ? String(context.scope) :
|
|
273
|
-
serviceName: context?.serviceName ? String(context.serviceName) :
|
|
272
|
+
scope: context?.scope ? String(context.scope) : undefined,
|
|
273
|
+
serviceName: context?.serviceName ? String(context.serviceName) : undefined,
|
|
274
274
|
methodName: context?.methodName
|
|
275
275
|
});
|
|
276
276
|
const sortedPlugins = [...this.plugins.values()].sort((a, b) => {
|
|
@@ -325,8 +325,8 @@ class PluginManager {
|
|
|
325
325
|
const errorContext = {
|
|
326
326
|
plugin: pluginName,
|
|
327
327
|
hook: hookName,
|
|
328
|
-
scope: context.scope ? String(context.scope) :
|
|
329
|
-
service: context.serviceName ? String(context.serviceName) :
|
|
328
|
+
scope: context.scope ? String(context.scope) : undefined,
|
|
329
|
+
service: context.serviceName ? String(context.serviceName) : undefined,
|
|
330
330
|
method: context.methodName
|
|
331
331
|
};
|
|
332
332
|
this.log(`Plugin error in ${pluginName}.${String(hookName)}:`, {
|
|
@@ -655,7 +655,7 @@ function createServiceFactory() {
|
|
|
655
655
|
scope: typedConfig.options.cache.scope || "request",
|
|
656
656
|
key: typedConfig.options.cache.key,
|
|
657
657
|
namespace: typedConfig.options.cache.namespace
|
|
658
|
-
} :
|
|
658
|
+
} : undefined,
|
|
659
659
|
plugins: methodPlugins[methodName]
|
|
660
660
|
}
|
|
661
661
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "silgi",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.13",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"import": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@anatine/zod-openapi": "^2.2.6",
|
|
49
|
-
"@antfu/eslint-config": "^3.12.
|
|
49
|
+
"@antfu/eslint-config": "^3.12.2",
|
|
50
50
|
"@asteasolutions/zod-to-openapi": "^7.3.0",
|
|
51
51
|
"@oxc-parser/wasm": "^0.44.0",
|
|
52
52
|
"c12": "^2.0.1",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"unbuild": "^3.2.0",
|
|
69
|
-
"silgi": "0.0.
|
|
69
|
+
"silgi": "0.0.13"
|
|
70
70
|
},
|
|
71
71
|
"resolutions": {
|
|
72
72
|
"silgi": "workspace:*"
|