silgi 0.41.41 → 0.41.43
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
CHANGED
|
@@ -327,7 +327,7 @@ async function registerModuleExportScan(silgi) {
|
|
|
327
327
|
if (!module.entryPath) {
|
|
328
328
|
continue;
|
|
329
329
|
}
|
|
330
|
-
const path = module.meta._packageName ? join$1(dirname(module.entryPath), "types/index.d.mts") : module.entryPath;
|
|
330
|
+
const path = module.meta._packageName ? join$1(dirname(module.entryPath), "types/index.d.mts") : join$1(dirname(module.entryPath), "types/index.ts");
|
|
331
331
|
const moduleTypes = await promises.readFile(path, "utf8").catch(() => "");
|
|
332
332
|
const normalisedModuleTypes = moduleTypes.replace(/export\s*\{.*?\}/gs, (match) => match.replace(/\b(type|interface)\b/g, ""));
|
|
333
333
|
for (const e of findTypeExports(normalisedModuleTypes)) {
|
|
@@ -339,7 +339,10 @@ async function registerModuleExportScan(silgi) {
|
|
|
339
339
|
const hasTypeExport = (name) => moduleReExports.find((exp) => exp.names?.includes(name));
|
|
340
340
|
const configKey = module.meta.configKey;
|
|
341
341
|
const moduleName = module.meta.name || module.meta._packageName;
|
|
342
|
-
const specifier = module.meta._packageName ? moduleName : relativeWithDot(
|
|
342
|
+
const specifier = module.meta._packageName ? moduleName : relativeWithDot(
|
|
343
|
+
silgi.options.build.typesDir,
|
|
344
|
+
join$1(dirname(module.entryPath), "types/index")
|
|
345
|
+
);
|
|
343
346
|
if (hasTypeExport("ModuleOptions")) {
|
|
344
347
|
const importName = hash(`${configKey}ModuleOptions`);
|
|
345
348
|
options.addImportItemType({
|
package/dist/cli/index.mjs
CHANGED