silgi 0.41.39 → 0.41.41
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/build.mjs +1 -0
- package/dist/cli/build.mjs +5 -4
- package/dist/cli/index.mjs +1 -1
- package/dist/cli/init.mjs +1 -0
- package/dist/cli/install.mjs +1 -0
- package/dist/cli/run.mjs +1 -0
- package/dist/cli/watch.mjs +1 -0
- package/dist/runtime/internal/nitro.mjs +1 -1
- package/dist/types/index.d.mts +1 -1
- package/package.json +1 -1
package/dist/build.mjs
CHANGED
package/dist/cli/build.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { consola } from 'consola';
|
|
2
2
|
import { createHooks, createDebugger } from 'hookable';
|
|
3
|
-
import { resolve, join, relative, extname, basename, dirname, isAbsolute } from 'pathe';
|
|
3
|
+
import { resolve, join, relative, extname, basename, dirname as dirname$1, isAbsolute } from 'pathe';
|
|
4
4
|
import { useSilgiCLI, replaceRuntimeValues, silgiCLICtx, autoImportTypes } from 'silgi';
|
|
5
5
|
import { isPresents, addTemplate, addCoreFile, genEnsureSafeVar, getServicePath, writeFile, relativeWithDot, hash, removeExtension, resolveAlias, directoryToURL, baseHeaderBannerComment, addImports, resolveSilgiPath, hasSilgiModule, normalizeTemplate, useLogger, toArray, isDirectory } from 'silgi/kit';
|
|
6
6
|
import { initRuntimeConfig, useRuntimeConfig, sharedRuntimeConfig } from 'silgi/runtime';
|
|
@@ -10,6 +10,7 @@ import * as p from '@clack/prompts';
|
|
|
10
10
|
import { existsSync, promises, readFileSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
11
11
|
import * as dotenv from 'dotenv';
|
|
12
12
|
import { genImport, genTypeImport, genObjectFromRawEntries, genAugmentation } from 'knitwork';
|
|
13
|
+
import { join as join$1, dirname } from 'node:path';
|
|
13
14
|
import { findTypeExports, findExports, resolvePath, parseNodeModulePath, lookupNodeModuleSubpath } from 'mlly';
|
|
14
15
|
import { createJiti } from 'dev-jiti';
|
|
15
16
|
import { h as hasInstalledModule } from './compatibility.mjs';
|
|
@@ -326,7 +327,7 @@ async function registerModuleExportScan(silgi) {
|
|
|
326
327
|
if (!module.entryPath) {
|
|
327
328
|
continue;
|
|
328
329
|
}
|
|
329
|
-
const path = module.meta._packageName ? module.entryPath
|
|
330
|
+
const path = module.meta._packageName ? join$1(dirname(module.entryPath), "types/index.d.mts") : module.entryPath;
|
|
330
331
|
const moduleTypes = await promises.readFile(path, "utf8").catch(() => "");
|
|
331
332
|
const normalisedModuleTypes = moduleTypes.replace(/export\s*\{.*?\}/gs, (match) => match.replace(/\b(type|interface)\b/g, ""));
|
|
332
333
|
for (const e of findTypeExports(normalisedModuleTypes)) {
|
|
@@ -690,7 +691,7 @@ function registerExportsWithHooks(silgiInstance, runtimeExports, typeExports, pa
|
|
|
690
691
|
}
|
|
691
692
|
async function verifyDirectoryCaseSensitivity(directoryPath, rootDirectory) {
|
|
692
693
|
const directoryName = basename(directoryPath);
|
|
693
|
-
const parentDirectory = dirname(directoryPath);
|
|
694
|
+
const parentDirectory = dirname$1(directoryPath);
|
|
694
695
|
try {
|
|
695
696
|
const siblingEntries = await readdir(parentDirectory);
|
|
696
697
|
if (!siblingEntries.includes(directoryName)) {
|
|
@@ -1585,7 +1586,7 @@ async function generateApp(app, options = {}) {
|
|
|
1585
1586
|
logger.info(`Compiled \`${template.filename}\` in ${setupTime}ms`);
|
|
1586
1587
|
}
|
|
1587
1588
|
if (template.modified && template.write) {
|
|
1588
|
-
dirs.add(dirname(fullPath));
|
|
1589
|
+
dirs.add(dirname$1(fullPath));
|
|
1589
1590
|
if (template.skipIfExists && existsSync(fullPath)) {
|
|
1590
1591
|
return;
|
|
1591
1592
|
}
|
package/dist/cli/index.mjs
CHANGED
package/dist/cli/init.mjs
CHANGED
package/dist/cli/install.mjs
CHANGED
package/dist/cli/run.mjs
CHANGED
package/dist/cli/watch.mjs
CHANGED
|
@@ -29,7 +29,7 @@ export async function addNitroApp(silgiContext = useSilgi()) {
|
|
|
29
29
|
}
|
|
30
30
|
const webhookServices = Object.entries(silgiContext.services).filter(([key]) => key.startsWith("websocket:")).map(([, value]) => value);
|
|
31
31
|
for (const webhook of webhookServices) {
|
|
32
|
-
nitro.router.use(webhook.path, defineWebSocketHandler(webhook.websocket
|
|
32
|
+
nitro.router.use(webhook.path, defineWebSocketHandler(webhook.websocket || {}));
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
export default addNitroApp;
|
package/dist/types/index.d.mts
CHANGED
|
@@ -713,7 +713,7 @@ interface ServiceSetup<Method extends HTTPMethod = HTTPMethod, Path extends stri
|
|
|
713
713
|
path: Path;
|
|
714
714
|
method?: Method;
|
|
715
715
|
handler?: ServiceHandler<Input, Output, PathParams, QueryParams, Resolved, HiddenParameters>;
|
|
716
|
-
websocket?:
|
|
716
|
+
websocket?: Partial<Hooks>;
|
|
717
717
|
rules?: MergeRouteRules;
|
|
718
718
|
modules?: Partial<SetupModuleOption>;
|
|
719
719
|
storage?: StorageConfig<ServiceHandlerInput<Input, PathParams, QueryParams, HiddenParameters>>;
|