silgi 0.13.0 → 0.14.0
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/index.mjs +1 -1
- package/dist/cli/loader.mjs +1 -0
- package/dist/cli/writeTypesAndFiles.mjs +18 -8
- package/dist/core/index.mjs +0 -2
- package/dist/meta/index.d.mts +1 -1
- package/dist/meta/index.d.ts +1 -1
- package/dist/presets/nitro/preset.mjs +2 -1
- package/dist/presets/nuxt/preset.mjs +2 -1
- package/dist/types/index.d.mts +2 -1
- package/dist/types/index.d.ts +2 -1
- package/package.json +1 -1
package/dist/_chunks/index.mjs
CHANGED
package/dist/cli/loader.mjs
CHANGED
|
@@ -1387,7 +1387,6 @@ function useCLIRuntimeConfig(silgi) {
|
|
|
1387
1387
|
const _sharedRuntimeConfig = initRuntimeConfig(silgi.options.envOptions, silgi.options.runtimeConfig);
|
|
1388
1388
|
silgi.options.runtimeConfig = _sharedRuntimeConfig;
|
|
1389
1389
|
silgi.hook("prepare:configs.ts", (data) => {
|
|
1390
|
-
data.storage = silgi.options.storage;
|
|
1391
1390
|
data.runtimeConfig = _sharedRuntimeConfig;
|
|
1392
1391
|
silgi.options.envOptions = silgi.options.envOptions;
|
|
1393
1392
|
});
|
|
@@ -1756,7 +1755,11 @@ async function prepareFramework(silgi) {
|
|
|
1756
1755
|
const importItems = {
|
|
1757
1756
|
"silgi/types": {
|
|
1758
1757
|
import: [
|
|
1759
|
-
{
|
|
1758
|
+
{
|
|
1759
|
+
name: "SilgiRuntimeContext",
|
|
1760
|
+
type: true,
|
|
1761
|
+
key: "SilgiRuntimeContext"
|
|
1762
|
+
}
|
|
1760
1763
|
],
|
|
1761
1764
|
from: "silgi/types"
|
|
1762
1765
|
}
|
|
@@ -1781,7 +1784,11 @@ async function createDTSFramework(silgi) {
|
|
|
1781
1784
|
const importItems = {
|
|
1782
1785
|
"silgi/types": {
|
|
1783
1786
|
import: [
|
|
1784
|
-
{
|
|
1787
|
+
{
|
|
1788
|
+
name: "SilgiRuntimeContext",
|
|
1789
|
+
type: true,
|
|
1790
|
+
key: "SilgiRuntimeContext"
|
|
1791
|
+
}
|
|
1785
1792
|
],
|
|
1786
1793
|
from: "silgi/types"
|
|
1787
1794
|
}
|
|
@@ -1996,11 +2003,14 @@ async function prepareSchema(silgi) {
|
|
|
1996
2003
|
"",
|
|
1997
2004
|
silgi.options.typescript.generateRuntimeConfigTypes ? generateTypes(
|
|
1998
2005
|
await resolveSchema(
|
|
1999
|
-
|
|
2000
|
-
Object.
|
|
2001
|
-
(
|
|
2002
|
-
|
|
2003
|
-
|
|
2006
|
+
{
|
|
2007
|
+
...Object.fromEntries(
|
|
2008
|
+
Object.entries(silgi.options.runtimeConfig).filter(
|
|
2009
|
+
([key]) => !["app", "nitro", "nuxt"].includes(key)
|
|
2010
|
+
)
|
|
2011
|
+
),
|
|
2012
|
+
...silgi.options.storages
|
|
2013
|
+
}
|
|
2004
2014
|
),
|
|
2005
2015
|
{
|
|
2006
2016
|
interfaceName: "SilgiRuntimeConfigExtends",
|
package/dist/core/index.mjs
CHANGED
|
@@ -5,7 +5,6 @@ import { getContext } from 'unctx';
|
|
|
5
5
|
import { Buffer } from 'node:buffer';
|
|
6
6
|
import { klona } from 'klona';
|
|
7
7
|
import { createStorage as createStorage$1, builtinDrivers, prefixStorage } from 'unstorage';
|
|
8
|
-
import memoryDriver from 'unstorage/drivers/memory';
|
|
9
8
|
|
|
10
9
|
const silgiCtx = getContext("silgi");
|
|
11
10
|
function useSilgi() {
|
|
@@ -423,7 +422,6 @@ async function createStorage(silgi) {
|
|
|
423
422
|
for (const [path, opts] of Object.entries(mounts)) {
|
|
424
423
|
if (opts.driver) {
|
|
425
424
|
const driver = await import(builtinDrivers[opts.driver] || opts.driver).then((r) => r.default || r);
|
|
426
|
-
storage.mount("/memory:cache", memoryDriver());
|
|
427
425
|
storage.mount(path, driver(opts));
|
|
428
426
|
} else {
|
|
429
427
|
silgi.logger.warn(`No \`driver\` set for storage mount point "${path}".`);
|
package/dist/meta/index.d.mts
CHANGED
package/dist/meta/index.d.ts
CHANGED
package/dist/types/index.d.mts
CHANGED
|
@@ -569,6 +569,7 @@ interface SilgiCLIOptions extends PresetOptions {
|
|
|
569
569
|
runtimeConfig: SilgiRuntimeConfig$1 & {
|
|
570
570
|
[key: string]: any;
|
|
571
571
|
};
|
|
572
|
+
storages: string[];
|
|
572
573
|
namespaces: string[];
|
|
573
574
|
hooks: NestedHooks<SilgiCLIHooks$1>;
|
|
574
575
|
plugins: {
|
|
@@ -902,7 +903,7 @@ interface SilgiStorageBase {
|
|
|
902
903
|
type StorageKeyGenerator<TInput> = (input: TInput) => string | Promise<string>;
|
|
903
904
|
interface StorageConfig<TInput> {
|
|
904
905
|
options: TransactionOptions;
|
|
905
|
-
base: '
|
|
906
|
+
base: 'memory' | keyof SilgiStorageBase;
|
|
906
907
|
key?: StorageKeyGenerator<TInput>;
|
|
907
908
|
scope?: 'request' | 'global';
|
|
908
909
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -569,6 +569,7 @@ interface SilgiCLIOptions extends PresetOptions {
|
|
|
569
569
|
runtimeConfig: SilgiRuntimeConfig$1 & {
|
|
570
570
|
[key: string]: any;
|
|
571
571
|
};
|
|
572
|
+
storages: string[];
|
|
572
573
|
namespaces: string[];
|
|
573
574
|
hooks: NestedHooks<SilgiCLIHooks$1>;
|
|
574
575
|
plugins: {
|
|
@@ -902,7 +903,7 @@ interface SilgiStorageBase {
|
|
|
902
903
|
type StorageKeyGenerator<TInput> = (input: TInput) => string | Promise<string>;
|
|
903
904
|
interface StorageConfig<TInput> {
|
|
904
905
|
options: TransactionOptions;
|
|
905
|
-
base: '
|
|
906
|
+
base: 'memory' | keyof SilgiStorageBase;
|
|
906
907
|
key?: StorageKeyGenerator<TInput>;
|
|
907
908
|
scope?: 'request' | 'global';
|
|
908
909
|
}
|