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.
@@ -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
- const runtimeFolder = new URL("runtime", src);
768
- await scanSilgiExports(runtimeFolder.pathname, buildTimeModuleMeta._packageName);
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") {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { defineCommand, runMain } from 'citty';
3
3
 
4
- const version = "0.34.9";
4
+ const version = "0.34.10";
5
5
  const packageJson = {
6
6
  version: version};
7
7
 
@@ -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 };
@@ -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
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.34.9",
4
+ "version": "0.34.10",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {