silgi 0.34.9 → 0.34.10
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/cli/build.mjs +5 -2
- package/dist/cli/index.mjs +1 -1
- package/dist/kit/index.d.mts +1 -1
- package/dist/kit/index.mjs +2 -2
- package/package.json +1 -1
package/dist/cli/build.mjs
CHANGED
|
@@ -592,6 +592,7 @@ function transformImportPath(path, packageName, relativeTo) {
|
|
|
592
592
|
const distMatch = importPath.match(/.*?(\/dist\/.*)/);
|
|
593
593
|
if (distMatch && distMatch[1]) {
|
|
594
594
|
importPath = packageName + distMatch[1].substring("/dist".length);
|
|
595
|
+
importPath = removeExtension(importPath, true);
|
|
595
596
|
}
|
|
596
597
|
} else if (relativeTo) {
|
|
597
598
|
importPath = removeExtension(relativeWithDot(relativeTo, path));
|
|
@@ -764,8 +765,10 @@ async function _resolveSilgiModule(silgiModule, silgi) {
|
|
|
764
765
|
};
|
|
765
766
|
}
|
|
766
767
|
}
|
|
767
|
-
|
|
768
|
-
|
|
768
|
+
if (!isPresents(["npm-package"])) {
|
|
769
|
+
const runtimeFolder = new URL("runtime", src);
|
|
770
|
+
await scanSilgiExports(runtimeFolder.pathname, buildTimeModuleMeta._packageName);
|
|
771
|
+
}
|
|
769
772
|
} catch (error) {
|
|
770
773
|
const code = error.code;
|
|
771
774
|
if (code === "MODULE_NOT_FOUND" || code === "ERR_PACKAGE_PATH_NOT_EXPORTED" || code === "ERR_MODULE_NOT_FOUND" || code === "ERR_UNSUPPORTED_DIR_IMPORT" || code === "ENOTDIR") {
|
package/dist/cli/index.mjs
CHANGED
package/dist/kit/index.d.mts
CHANGED
|
@@ -309,7 +309,7 @@ declare const baseHeaderBannerComment: string[];
|
|
|
309
309
|
declare function processFilePath(src: string): string;
|
|
310
310
|
declare function isPresents(names: PresetName[]): boolean;
|
|
311
311
|
declare function isRuntimePresents(names: PresetName[]): boolean;
|
|
312
|
-
declare function removeExtension(filePath: string): string;
|
|
312
|
+
declare function removeExtension(filePath: string, force?: boolean): string;
|
|
313
313
|
|
|
314
314
|
export { MODE_RE, MigrationStatus, addCommands, addCoreFile, addImports, addNPMPackage, addTemplate, baseHeaderBannerComment, createFunction, createFunctionConfigs, createResolver, defineFramework, defineSilgiModule, defineSilgiPreset, directoryToURL, filterInPlace, formatFunctions, genEnsureSafeVar, generateMigration, getAllEntries, getIpAddress, getMigration, hasError, hasInstalledModule, hasSilgiModule, hash, ipAddress, isDirectory, isH3, isNitro, isNuxt, isPresents, isRuntimePresents, listMigrations, migrationDown, migrationUp, normalizeTemplate, prettyPath, processFilePath, relativeWithDot, removeExtension, resolveAlias, resolvePath, resolveSilgiModule, resolveSilgiPath, toArray, tryResolveModule, useLogger, useRequest, useResponse, writeFile };
|
|
315
315
|
export type { FunctionConfig, JsonPatch, MigrationData, MigrationInfo, MigrationOptions, MigrationResult };
|
package/dist/kit/index.mjs
CHANGED
|
@@ -67,9 +67,9 @@ function isRuntimePresents(names) {
|
|
|
67
67
|
const silgi = useSilgi();
|
|
68
68
|
return names.includes(silgi.options.present);
|
|
69
69
|
}
|
|
70
|
-
function removeExtension(filePath) {
|
|
70
|
+
function removeExtension(filePath, force = false) {
|
|
71
71
|
const silgi = useSilgiCLI();
|
|
72
|
-
if (silgi.options.typescript.removeFileExtension) {
|
|
72
|
+
if (silgi.options.typescript.removeFileExtension || force) {
|
|
73
73
|
const ext = extname(filePath);
|
|
74
74
|
return ext ? filePath.slice(0, -ext.length) : filePath;
|
|
75
75
|
}
|