silgi 0.24.17 → 0.24.19
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/path.mjs +62 -0
- package/dist/cli/{commands/dev.mjs → dev.mjs} +10 -7
- package/dist/cli/{commands/env.mjs → env.mjs} +2 -2
- package/dist/cli/index.mjs +9 -6
- package/dist/cli/{commands/install.mjs → install.mjs} +6 -3
- package/dist/cli/{commands/run.mjs → prepare.mjs} +85 -13
- package/dist/index.d.mts +41 -40
- package/dist/index.mjs +4165 -20
- package/dist/kit/index.mjs +501 -15
- package/dist/runtime/internal/config.mjs +3 -3
- package/dist/runtime/internal/nitro.d.mts +1 -1
- package/dist/runtime/internal/nitro.mjs +5 -5
- package/package.json +1 -2
- package/dist/cli/build/prepare.mjs +0 -43
- package/dist/cli/commands/prepare.mjs +0 -66
- package/dist/cli/config/defaults.mjs +0 -129
- package/dist/cli/config/index.d.mts +0 -11
- package/dist/cli/config/index.mjs +0 -2
- package/dist/cli/config/loader.mjs +0 -97
- package/dist/cli/config/resolvers/compatibility.mjs +0 -90
- package/dist/cli/config/resolvers/imports.mjs +0 -96
- package/dist/cli/config/resolvers/paths.mjs +0 -167
- package/dist/cli/config/resolvers/storage.mjs +0 -25
- package/dist/cli/config/resolvers/url.mjs +0 -7
- package/dist/cli/config/types.mjs +0 -191
- package/dist/cli/core/app.mjs +0 -92
- package/dist/cli/core/devServer.mjs +0 -8
- package/dist/cli/core/env.mjs +0 -76
- package/dist/cli/core/installPackage.mjs +0 -31
- package/dist/cli/core/prepare.mjs +0 -7
- package/dist/cli/core/runtimeConfig.mjs +0 -14
- package/dist/cli/core/scan.mjs +0 -39
- package/dist/cli/core/silgi.mjs +0 -125
- package/dist/cli/core/templates.mjs +0 -31
- package/dist/cli/framework/emptyFramework.mjs +0 -9
- package/dist/cli/framework/h3.mjs +0 -89
- package/dist/cli/framework/index.mjs +0 -8
- package/dist/cli/framework/nitro.mjs +0 -106
- package/dist/cli/framework/nuxt.mjs +0 -9
- package/dist/cli/module/exportScan.mjs +0 -130
- package/dist/cli/module/install.mjs +0 -59
- package/dist/cli/module/scan.mjs +0 -227
- package/dist/cli/scan/commands.mjs +0 -47
- package/dist/cli/scan/prepareConfigs.mjs +0 -46
- package/dist/cli/scan/prepareCoreFile.mjs +0 -166
- package/dist/cli/scan/prepareFramework.mjs +0 -73
- package/dist/cli/scan/prepareSchema.mjs +0 -177
- package/dist/cli/scan/prepareServerFiles.mjs +0 -119
- package/dist/cli/scan/scanExportFile.mjs +0 -155
- package/dist/cli/scan/writeCoreFile.mjs +0 -34
- package/dist/cli/scan/writeScanFiles.mjs +0 -30
- package/dist/cli/scan/writeTypesAndFiles.mjs +0 -109
- package/dist/cli/utils/build-uri-map.mjs +0 -39
- package/dist/cli/utils/common.mjs +0 -13
- package/dist/cli/utils/compatibility.mjs +0 -30
- package/dist/cli/utils/generateRouterDTS.mjs +0 -80
- package/dist/cli/utils/ignore.mjs +0 -46
- package/dist/cli/utils/parser.mjs +0 -168
- package/dist/cli/utils/readScanFile.mjs +0 -79
- package/dist/cli/utils/storage.mjs +0 -25
- package/dist/core/createSilgi.mjs +0 -76
- package/dist/core/error.mjs +0 -227
- package/dist/core/index.mjs +0 -8
- package/dist/core/routeRules.mjs +0 -288
- package/dist/core/silgi.mjs +0 -128
- package/dist/core/silgiApp.mjs +0 -25
- package/dist/core/storage.mjs +0 -15
- package/dist/core/unctx.mjs +0 -27
- package/dist/core/uris/uri.mjs +0 -33
- package/dist/core/uris/utils.mjs +0 -130
- package/dist/core/utils/event.mjs +0 -15
- package/dist/core/utils/merge.mjs +0 -29
- package/dist/core/utils/runtime.mjs +0 -22
- package/dist/core/utils/schema.mjs +0 -5
- package/dist/core/utils/service.mjs +0 -5
- package/dist/core/utils/shared.mjs +0 -5
- package/dist/core/utils/storage.mjs +0 -72
- package/dist/kit/errors.mjs +0 -11
- package/dist/kit/esm.mjs +0 -14
- package/dist/kit/fs.mjs +0 -30
- package/dist/kit/gen.mjs +0 -44
- package/dist/kit/hash.mjs +0 -8
- package/dist/kit/isFramework.mjs +0 -25
- package/dist/kit/logger.mjs +0 -7
- package/dist/kit/module.mjs +0 -73
- package/dist/kit/parseServices.mjs +0 -57
- package/dist/kit/path.mjs +0 -34
- package/dist/kit/preset.mjs +0 -6
- package/dist/kit/resolve.mjs +0 -80
- package/dist/kit/template.mjs +0 -49
- package/dist/kit/useRequest.mjs +0 -91
- package/dist/kit/utils.mjs +0 -43
- package/dist/package.json.mjs +0 -5
- /package/dist/cli/{commands/init.mjs → init.mjs} +0 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import satisfies from 'semver/functions/satisfies.js';
|
|
2
|
+
import { useSilgi } from 'silgi';
|
|
3
|
+
import { version } from 'silgi/meta';
|
|
4
|
+
import consola from 'consola';
|
|
5
|
+
import { colors } from 'consola/utils';
|
|
6
|
+
import { getProperty } from 'dot-prop';
|
|
7
|
+
import { relative, resolve } from 'pathe';
|
|
8
|
+
|
|
9
|
+
const SEMANTIC_VERSION_RE = /-\d+\.[0-9a-f]+/;
|
|
10
|
+
function normalizeSemanticVersion(version) {
|
|
11
|
+
return version.replace(SEMANTIC_VERSION_RE, "");
|
|
12
|
+
}
|
|
13
|
+
const SILGI_VERSION_RE = /^v/g;
|
|
14
|
+
async function checkSilgiCompatibility(constraints, silgi = useSilgi()) {
|
|
15
|
+
const issues = [];
|
|
16
|
+
if (constraints.silgi) {
|
|
17
|
+
const _silgiVersion = version.replace(SILGI_VERSION_RE, "");
|
|
18
|
+
if (!satisfies(normalizeSemanticVersion(_silgiVersion), constraints.silgi, { includePrerelease: true })) {
|
|
19
|
+
issues.push({
|
|
20
|
+
name: "silgi",
|
|
21
|
+
message: `Silgi version \`${constraints.silgi}\` is required but currently using \`${version}\``
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
await silgi.callHook("kit:compatibility", constraints, issues);
|
|
26
|
+
issues.toString = () => issues.map((issue) => ` - [${issue.name}] ${issue.message}`).join("\n");
|
|
27
|
+
return issues;
|
|
28
|
+
}
|
|
29
|
+
function hasInstalledModule(moduleKey, silgi = useSilgi()) {
|
|
30
|
+
const find = silgi.scanModules.find(({ meta }) => meta.configKey === moduleKey);
|
|
31
|
+
return find?.installed ?? false;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function prettyPath(p, highlight = true) {
|
|
35
|
+
p = relative(process.cwd(), p);
|
|
36
|
+
return highlight ? colors.cyan(p) : p;
|
|
37
|
+
}
|
|
38
|
+
function resolveSilgiPath(path, silgiCLIOptions, base) {
|
|
39
|
+
if (typeof path !== "string") {
|
|
40
|
+
throw new TypeError(`Invalid path: ${path}`);
|
|
41
|
+
}
|
|
42
|
+
path = _compilePathTemplate(path)(silgiCLIOptions);
|
|
43
|
+
for (const base2 in silgiCLIOptions.alias) {
|
|
44
|
+
if (path.startsWith(base2)) {
|
|
45
|
+
path = silgiCLIOptions.alias[base2] + path.slice(base2.length);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return resolve(base || silgiCLIOptions.srcDir, path);
|
|
49
|
+
}
|
|
50
|
+
function _compilePathTemplate(contents) {
|
|
51
|
+
return (params) => contents.replace(/\{\{ ?([\w.]+) ?\}\}/g, (_, match) => {
|
|
52
|
+
const val = getProperty(params, match);
|
|
53
|
+
if (!val) {
|
|
54
|
+
consola.warn(
|
|
55
|
+
`cannot resolve template param '${match}' in ${contents.slice(0, 20)}`
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
return val || `${match}`;
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { checkSilgiCompatibility as c, hasInstalledModule as h, prettyPath as p, resolveSilgiPath as r };
|
|
@@ -3,12 +3,15 @@ import { watch } from 'chokidar';
|
|
|
3
3
|
import { defineCommand, runCommand } from 'citty';
|
|
4
4
|
import consola from 'consola';
|
|
5
5
|
import { join } from 'pathe';
|
|
6
|
-
import {
|
|
6
|
+
import { useSilgi, reloadScan, silgiClose } from 'silgi';
|
|
7
7
|
import { version } from 'silgi/meta';
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
8
|
+
import { c as commonArgs, p as prepare } from './prepare.mjs';
|
|
9
|
+
import 'node:child_process';
|
|
10
|
+
import 'node:fs';
|
|
11
|
+
import '@clack/prompts';
|
|
12
|
+
import 'dev-jiti';
|
|
13
|
+
import 'picocolors';
|
|
14
|
+
import './env.mjs';
|
|
12
15
|
|
|
13
16
|
const dev = defineCommand({
|
|
14
17
|
meta: {
|
|
@@ -31,7 +34,7 @@ const dev = defineCommand({
|
|
|
31
34
|
await runCommand(prepare, {
|
|
32
35
|
rawArgs: ["--commands", "run", "--dev", "true"]
|
|
33
36
|
});
|
|
34
|
-
const silgi =
|
|
37
|
+
const silgi = useSilgi();
|
|
35
38
|
silgi.options.watchOptions.ignored ??= [];
|
|
36
39
|
silgi.options.watchOptions.ignoreInitial = true;
|
|
37
40
|
if (Array.isArray(silgi.options.watchOptions.ignored)) {
|
|
@@ -80,7 +83,7 @@ const dev = defineCommand({
|
|
|
80
83
|
if (watcher) {
|
|
81
84
|
watcher.close();
|
|
82
85
|
}
|
|
83
|
-
await
|
|
86
|
+
await silgiClose();
|
|
84
87
|
process.exit(0);
|
|
85
88
|
});
|
|
86
89
|
consola.withTag("silgi").success("Prepare completed");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as p from '@clack/prompts';
|
|
2
|
-
import { setupDotenv } from '
|
|
2
|
+
import { setupDotenv } from 'silgi';
|
|
3
3
|
|
|
4
4
|
let initialized = false;
|
|
5
5
|
async function prepareEnv(silgiConfig) {
|
|
@@ -37,4 +37,4 @@ async function prepareEnv(silgiConfig) {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
export { prepareEnv };
|
|
40
|
+
export { prepareEnv as p };
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { defineCommand, runMain } from 'citty';
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
const version = "0.24.19";
|
|
5
|
+
const packageJson = {
|
|
6
|
+
version: version};
|
|
4
7
|
|
|
5
8
|
const main = defineCommand({
|
|
6
9
|
meta: {
|
|
@@ -15,11 +18,11 @@ const main = defineCommand({
|
|
|
15
18
|
}
|
|
16
19
|
},
|
|
17
20
|
subCommands: {
|
|
18
|
-
prepare: () => import('./
|
|
19
|
-
init: () => import('./
|
|
20
|
-
run: () => import('./
|
|
21
|
-
install: () => import('./
|
|
22
|
-
dev: () => import('./
|
|
21
|
+
prepare: () => import('./prepare.mjs').then(function (n) { return n.a; }).then((m) => m.default),
|
|
22
|
+
init: () => import('./init.mjs').then((m) => m.default),
|
|
23
|
+
run: () => import('./prepare.mjs').then(function (n) { return n.r; }).then((m) => m.default),
|
|
24
|
+
install: () => import('./install.mjs').then((m) => m.default),
|
|
25
|
+
dev: () => import('./dev.mjs').then((m) => m.default)
|
|
23
26
|
},
|
|
24
27
|
run({ args }) {
|
|
25
28
|
if (args.version)
|
|
@@ -3,10 +3,13 @@ import { readFileSync } from 'node:fs';
|
|
|
3
3
|
import { defineCommand, runCommand } from 'citty';
|
|
4
4
|
import { consola } from 'consola';
|
|
5
5
|
import { resolve } from 'pathe';
|
|
6
|
+
import { loadOptions } from 'silgi';
|
|
6
7
|
import { version } from 'silgi/meta';
|
|
7
|
-
import { commonArgs } from '
|
|
8
|
-
import
|
|
9
|
-
import
|
|
8
|
+
import { c as commonArgs, p as prepare } from './prepare.mjs';
|
|
9
|
+
import '@clack/prompts';
|
|
10
|
+
import 'dev-jiti';
|
|
11
|
+
import 'picocolors';
|
|
12
|
+
import './env.mjs';
|
|
10
13
|
|
|
11
14
|
const install = defineCommand({
|
|
12
15
|
meta: {
|
|
@@ -1,18 +1,26 @@
|
|
|
1
|
+
import { defineCommand, runCommand } from 'citty';
|
|
2
|
+
import { resolve } from 'pathe';
|
|
3
|
+
import { useSilgi, loadOptions, silgiClose, createSilgi, prepare as prepare$2, writeTypesAndFiles, writeCoreFile, prepareBuild } from 'silgi';
|
|
4
|
+
import { version } from 'silgi/meta';
|
|
1
5
|
import { execSync } from 'node:child_process';
|
|
2
6
|
import { readFileSync } from 'node:fs';
|
|
3
7
|
import * as p from '@clack/prompts';
|
|
4
|
-
import { defineCommand, runCommand } from 'citty';
|
|
5
8
|
import { consola } from 'consola';
|
|
6
9
|
import { createJiti } from 'dev-jiti';
|
|
7
|
-
import { resolve } from 'pathe';
|
|
8
10
|
import color from 'picocolors';
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
import { p as prepareEnv } from './env.mjs';
|
|
12
|
+
|
|
13
|
+
const commonArgs = {
|
|
14
|
+
dir: {
|
|
15
|
+
type: "string",
|
|
16
|
+
description: "project root directory"
|
|
17
|
+
},
|
|
18
|
+
_dir: {
|
|
19
|
+
type: "positional",
|
|
20
|
+
default: ".",
|
|
21
|
+
description: "project root directory (prefer using `--dir`)"
|
|
22
|
+
}
|
|
23
|
+
};
|
|
16
24
|
|
|
17
25
|
const run = defineCommand({
|
|
18
26
|
meta: {
|
|
@@ -43,7 +51,7 @@ const run = defineCommand({
|
|
|
43
51
|
consola.error("Silgi not found");
|
|
44
52
|
return;
|
|
45
53
|
}
|
|
46
|
-
const silgi =
|
|
54
|
+
const silgi = useSilgi();
|
|
47
55
|
const tags = args.tag?.split(",").map((t) => t.trim());
|
|
48
56
|
p.intro(color.bold(`Silgi CLI ${color.green(`v${version}`)}`));
|
|
49
57
|
const silgiConfig = await loadOptions({});
|
|
@@ -157,7 +165,7 @@ const run = defineCommand({
|
|
|
157
165
|
alias: silgiConfig.alias
|
|
158
166
|
});
|
|
159
167
|
let cleanHandler = cmd.handler.handler.replace(/\n/g, "");
|
|
160
|
-
cleanHandler = `import {
|
|
168
|
+
cleanHandler = `import { silgiCtx } from 'silgi'
|
|
161
169
|
${cleanHandler}
|
|
162
170
|
`;
|
|
163
171
|
await jiti.evalModule(cleanHandler, {
|
|
@@ -168,8 +176,72 @@ const run = defineCommand({
|
|
|
168
176
|
});
|
|
169
177
|
}
|
|
170
178
|
}
|
|
171
|
-
await
|
|
179
|
+
await silgiClose();
|
|
172
180
|
}
|
|
173
181
|
});
|
|
174
182
|
|
|
175
|
-
|
|
183
|
+
const run$1 = {
|
|
184
|
+
__proto__: null,
|
|
185
|
+
default: run
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
const prepare = defineCommand({
|
|
189
|
+
meta: {
|
|
190
|
+
name: "prepare",
|
|
191
|
+
description: "Generate types for the project",
|
|
192
|
+
version: version
|
|
193
|
+
},
|
|
194
|
+
args: {
|
|
195
|
+
...commonArgs,
|
|
196
|
+
preset: {
|
|
197
|
+
type: "string",
|
|
198
|
+
description: "The build preset to use (you can also use `SILGI_PRESET` environment variable)."
|
|
199
|
+
},
|
|
200
|
+
stub: {
|
|
201
|
+
type: "boolean",
|
|
202
|
+
description: "Run in silgi development mode"
|
|
203
|
+
},
|
|
204
|
+
dev: {
|
|
205
|
+
type: "boolean",
|
|
206
|
+
description: "Run in silgi development mode"
|
|
207
|
+
},
|
|
208
|
+
env: {
|
|
209
|
+
type: "string",
|
|
210
|
+
description: "The environment to use"
|
|
211
|
+
},
|
|
212
|
+
commands: {
|
|
213
|
+
type: "string",
|
|
214
|
+
description: "The commands to run"
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
async run({ args }) {
|
|
218
|
+
const rootDir = resolve(args.dir || args._dir || ".");
|
|
219
|
+
const silgi = await createSilgi({
|
|
220
|
+
rootDir,
|
|
221
|
+
dev: args.dev || args.stub,
|
|
222
|
+
stub: args.stub,
|
|
223
|
+
preset: args.preset,
|
|
224
|
+
commandType: "prepare",
|
|
225
|
+
activeEnvironment: args.env
|
|
226
|
+
});
|
|
227
|
+
await prepare$2(silgi);
|
|
228
|
+
await writeTypesAndFiles(silgi);
|
|
229
|
+
await writeCoreFile(silgi);
|
|
230
|
+
await prepareBuild(silgi);
|
|
231
|
+
if (!args.commands) {
|
|
232
|
+
await runCommand(run, {
|
|
233
|
+
rawArgs: ["--tag", "init", "--active", "false"]
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
return {
|
|
237
|
+
silgi
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
const prepare$1 = {
|
|
243
|
+
__proto__: null,
|
|
244
|
+
default: prepare
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
export { prepare$1 as a, commonArgs as c, prepare as p, run$1 as r };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,22 +1,30 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as unctx from 'unctx';
|
|
2
|
+
import { Silgi, SilgiCLI, SilgiConfig, SilgiEvents, SilgiFunction, SilgiOperation, MergedSilgiSchema, ServiceType, SilgiSchema, RequiredServiceType, SilgiRuntimeSharedsExtend, SilgiRuntimeContext, DefaultNamespaces, BaseSchemaType, SilgiRuntimeShareds, StorageConfig, SilgiStorageBase, SilgiCLIConfig, LoadConfigOptions, SilgiCLIOptions, DotenvOptions } from 'silgi/types';
|
|
2
3
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
3
4
|
import { Storage, StorageValue } from 'unstorage';
|
|
4
|
-
import
|
|
5
|
+
import { Stats } from 'node:fs';
|
|
5
6
|
|
|
7
|
+
declare const silgiAppCtx: unctx.UseContext<Silgi>;
|
|
8
|
+
declare const silgiCtx: unctx.UseContext<SilgiCLI>;
|
|
9
|
+
declare function useSilgiApp(): Silgi;
|
|
6
10
|
/**
|
|
7
|
-
*
|
|
11
|
+
* Get access to Nuxt instance.
|
|
12
|
+
*
|
|
13
|
+
* Returns null if Nuxt instance is unavailable.
|
|
14
|
+
* @example
|
|
15
|
+
* ```js
|
|
16
|
+
* const silgi = tryUseSilgiApp()
|
|
17
|
+
* if (silgi) {
|
|
18
|
+
* // Do something
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
8
21
|
*/
|
|
9
|
-
declare function
|
|
22
|
+
declare function tryUseSilgiApp(): Silgi | null;
|
|
23
|
+
declare function useSilgi(): SilgiCLI;
|
|
24
|
+
declare function silgiClose(): Promise<void>;
|
|
25
|
+
declare function tryUseSilgi(): SilgiCLI | null;
|
|
10
26
|
|
|
11
|
-
declare function
|
|
12
|
-
|
|
13
|
-
declare function createSilgiCLI(config?: SilgiCLIConfig, opts?: LoadConfigOptions): Promise<SilgiCLI>;
|
|
14
|
-
|
|
15
|
-
declare function writeCoreFile(silgi: SilgiCLI): Promise<void>;
|
|
16
|
-
|
|
17
|
-
declare function writeTypesAndFiles(silgi: SilgiCLI): Promise<void>;
|
|
18
|
-
|
|
19
|
-
declare function createSilgi(config: SilgiConfig): Promise<Silgi>;
|
|
27
|
+
declare function createSilgiApp(config: SilgiConfig): Promise<Silgi>;
|
|
20
28
|
|
|
21
29
|
declare function silgi(event?: SilgiEvents | Record<string, any>): SilgiFunction;
|
|
22
30
|
|
|
@@ -244,41 +252,34 @@ declare class SilgiError extends Error implements BaseError {
|
|
|
244
252
|
}
|
|
245
253
|
declare function isBaseError(error: unknown): error is BaseError;
|
|
246
254
|
|
|
247
|
-
declare
|
|
248
|
-
|
|
255
|
+
declare function storageMount<T extends Storage = Storage>(silgi?: Silgi): (base: keyof SilgiStorageBase, driver: Parameters<Storage['mount']>[1]) => T;
|
|
256
|
+
|
|
257
|
+
declare function loadOptions(configOverrides?: SilgiCLIConfig, opts?: LoadConfigOptions): Promise<SilgiCLIOptions>;
|
|
258
|
+
|
|
249
259
|
/**
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
* Returns null if Nuxt instance is unavailable.
|
|
253
|
-
* @example
|
|
254
|
-
* ```js
|
|
255
|
-
* const silgi = tryUseSilgi()
|
|
256
|
-
* if (silgi) {
|
|
257
|
-
* // Do something
|
|
258
|
-
* }
|
|
259
|
-
* ```
|
|
260
|
+
* Prepares route rules for the build
|
|
260
261
|
*/
|
|
261
|
-
declare function
|
|
262
|
+
declare function prepareBuild(silgi: SilgiCLI): Promise<void>;
|
|
263
|
+
|
|
264
|
+
declare function prepare(_silgi: SilgiCLI): Promise<void>;
|
|
265
|
+
|
|
266
|
+
declare function reloadScan(path: string, _stats?: Stats): Promise<void>;
|
|
262
267
|
|
|
263
|
-
|
|
264
|
-
declare function useSilgiCLI(): SilgiCLI;
|
|
268
|
+
type Env = typeof process.env;
|
|
265
269
|
/**
|
|
266
|
-
*
|
|
270
|
+
* Load and interpolate environment variables into `process.env`.
|
|
271
|
+
* If you need more control (or access to the values), consider using `loadDotenv` instead
|
|
267
272
|
*
|
|
268
|
-
* Returns null if Nuxt instance is unavailable.
|
|
269
|
-
* @example
|
|
270
|
-
* ```js
|
|
271
|
-
* const silgi = tryUseSilgi()
|
|
272
|
-
* if (silgi) {
|
|
273
|
-
* // Do something
|
|
274
|
-
* }
|
|
275
|
-
* ```
|
|
276
273
|
*/
|
|
277
|
-
declare function
|
|
274
|
+
declare function setupDotenv(options: DotenvOptions): Promise<Env>;
|
|
278
275
|
|
|
279
|
-
declare function
|
|
276
|
+
declare function createSilgi(config?: SilgiCLIConfig, opts?: LoadConfigOptions): Promise<SilgiCLI>;
|
|
277
|
+
|
|
278
|
+
declare function writeCoreFile(silgi: SilgiCLI): Promise<void>;
|
|
279
|
+
|
|
280
|
+
declare function writeTypesAndFiles(silgi: SilgiCLI): Promise<void>;
|
|
280
281
|
|
|
281
282
|
declare const autoImportTypes: string[];
|
|
282
283
|
|
|
283
|
-
export { ErrorCategory, ErrorFactory, ErrorSeverity, HttpStatus, SilgiError, autoImportTypes, createSchema, createService, createShared, createSilgi,
|
|
284
|
+
export { ErrorCategory, ErrorFactory, ErrorSeverity, HttpStatus, SilgiError, autoImportTypes, createSchema, createService, createShared, createSilgi, createSilgiApp, createStorage, getEvent, getEventContext, isBaseError, loadOptions, mergeSchemas, mergeServices, mergeShared, parseURI, prepare, prepareBuild, reloadScan, replaceRuntimeValues, setupDotenv, silgi, silgiAppCtx, silgiClose, silgiCtx, storageMount, tryUseSilgi, tryUseSilgiApp, useSilgi, useSilgiApp, useSilgiStorage, writeCoreFile, writeTypesAndFiles };
|
|
284
285
|
export type { BaseError, ErrorMetadata };
|