silgi 0.24.23 → 0.25.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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import consola from 'consola';
|
|
2
|
-
import {
|
|
2
|
+
import { getContext } from 'unctx';
|
|
3
3
|
|
|
4
|
-
const silgiCLICtx =
|
|
4
|
+
const silgiCLICtx = getContext("silgiCLI");
|
|
5
5
|
function useSilgiCLI() {
|
|
6
6
|
const instance = silgiCLICtx.tryUse();
|
|
7
7
|
if (!instance) {
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1873,7 +1873,7 @@ async function prepareCoreFile(data, frameworkContext, silgi) {
|
|
|
1873
1873
|
plugins.push(pluginImportName);
|
|
1874
1874
|
}
|
|
1875
1875
|
const importsContent = [
|
|
1876
|
-
'import
|
|
1876
|
+
'import { mergeDeep } from "silgi/runtime"',
|
|
1877
1877
|
...Object.entries(importItems).map(([_name, { from, import: imports }]) => {
|
|
1878
1878
|
if (silgi.options.typescript.removeFileExtension) {
|
|
1879
1879
|
from = from.replace(/\.(js|ts|mjs|cjs|jsx|tsx)$/, "");
|
|
@@ -1885,8 +1885,6 @@ async function prepareCoreFile(data, frameworkContext, silgi) {
|
|
|
1885
1885
|
""
|
|
1886
1886
|
];
|
|
1887
1887
|
const importData = [
|
|
1888
|
-
"",
|
|
1889
|
-
"const mergeDeep = deepmerge({all: true})",
|
|
1890
1888
|
"",
|
|
1891
1889
|
"export async function buildSilgi(framework: FrameworkContext, moduleOptions?: Partial<SilgiRuntimeOptions>,buildOptions?: Partial<SilgiOptions>) {",
|
|
1892
1890
|
"",
|
|
@@ -1903,18 +1901,13 @@ async function prepareCoreFile(data, frameworkContext, silgi) {
|
|
|
1903
1901
|
" modulesURIs,",
|
|
1904
1902
|
` plugins: [${plugins.join(", ")}],`,
|
|
1905
1903
|
_data._silgiConfigs.length > 0 ? ` ${_data._silgiConfigs.map((config) => typeof config === "string" ? config : typeof config === "object" ? Object.entries(config).map(([key, value]) => `${key}: ${value}`).join(",\n ") : "").join(",\n ")},` : "",
|
|
1906
|
-
" options: mergeDeep(",
|
|
1907
|
-
" {",
|
|
1904
|
+
" options: mergeDeep(cliConfigs, {",
|
|
1908
1905
|
" runtimeConfig: {} as SilgiRuntimeOptions,",
|
|
1909
1906
|
" routeRules: routeRules as any,",
|
|
1910
|
-
|
|
1911
|
-
" moduleOptions
|
|
1912
|
-
"
|
|
1913
|
-
|
|
1914
|
-
" ...cliConfigs,",
|
|
1915
|
-
" },",
|
|
1916
|
-
" buildOptions,",
|
|
1917
|
-
" ) as any,",
|
|
1907
|
+
` present: '${silgi.options.preset}',`,
|
|
1908
|
+
" ...moduleOptions,",
|
|
1909
|
+
" ...buildOptions,",
|
|
1910
|
+
" }) as any,",
|
|
1918
1911
|
" })",
|
|
1919
1912
|
"",
|
|
1920
1913
|
...frameworkContext,
|
package/dist/core/index.d.mts
CHANGED
|
@@ -249,18 +249,6 @@ declare function tryUseSilgi(): Silgi | null;
|
|
|
249
249
|
|
|
250
250
|
declare const silgiCLICtx: unctx.UseContext<SilgiCLI>;
|
|
251
251
|
declare function useSilgiCLI(): SilgiCLI;
|
|
252
|
-
/**
|
|
253
|
-
* Get access to Nuxt instance.
|
|
254
|
-
*
|
|
255
|
-
* Returns null if Nuxt instance is unavailable.
|
|
256
|
-
* @example
|
|
257
|
-
* ```js
|
|
258
|
-
* const silgi = tryUseSilgi()
|
|
259
|
-
* if (silgi) {
|
|
260
|
-
* // Do something
|
|
261
|
-
* }
|
|
262
|
-
* ```
|
|
263
|
-
*/
|
|
264
252
|
declare function tryUseSilgiCLI(): SilgiCLI | null;
|
|
265
253
|
|
|
266
254
|
declare function storageMount<T extends Storage = Storage>(silgi?: Silgi): (base: keyof SilgiStorageBase, driver: Parameters<Storage['mount']>[1]) => T;
|