silgi 0.20.24 → 0.20.25
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/index.mjs +1 -1
- package/dist/cli/common.mjs +12 -9
- package/dist/meta/index.d.mts +1 -1
- package/dist/meta/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/_chunks/index.mjs
CHANGED
package/dist/cli/common.mjs
CHANGED
|
@@ -903,7 +903,7 @@ async function prepareServerFiles(silgi) {
|
|
|
903
903
|
from: "./configs.ts"
|
|
904
904
|
}
|
|
905
905
|
};
|
|
906
|
-
const
|
|
906
|
+
const scanned = {
|
|
907
907
|
uris: {},
|
|
908
908
|
services: [],
|
|
909
909
|
shareds: [
|
|
@@ -915,16 +915,17 @@ async function prepareServerFiles(silgi) {
|
|
|
915
915
|
modulesURIs: {},
|
|
916
916
|
customImports: [],
|
|
917
917
|
importItems: JSON.parse(JSON.stringify(importItems))
|
|
918
|
-
}
|
|
919
|
-
const scanned = createScannedObject();
|
|
918
|
+
};
|
|
920
919
|
if (silgi.uris) {
|
|
921
|
-
|
|
920
|
+
scanned.uris = { ...silgi.uris };
|
|
922
921
|
}
|
|
923
922
|
if (silgi.modulesURIs) {
|
|
924
|
-
|
|
923
|
+
scanned.modulesURIs = { ...silgi.modulesURIs };
|
|
925
924
|
}
|
|
926
|
-
|
|
927
|
-
|
|
925
|
+
const prepareScanned = JSON.parse(JSON.stringify(scanned));
|
|
926
|
+
await silgi.callHook("prepare:scan.ts", prepareScanned);
|
|
927
|
+
Object.assign(scanned, prepareScanned);
|
|
928
|
+
if (scanned.importItems["#silgi/vfs"]?.import?.length === 0) {
|
|
928
929
|
delete scanned.importItems["#silgi/vfs"];
|
|
929
930
|
}
|
|
930
931
|
if (scanned.services.length > 0) {
|
|
@@ -942,12 +943,14 @@ async function prepareServerFiles(silgi) {
|
|
|
942
943
|
scanned.services = deduplicateArray(scanned.services);
|
|
943
944
|
scanned.schemas = deduplicateArray(scanned.schemas);
|
|
944
945
|
scanned.shareds = deduplicateArray(scanned.shareds);
|
|
946
|
+
scanned.customImports = deduplicateArray(scanned.customImports);
|
|
945
947
|
const importsContent = [
|
|
946
948
|
...Object.entries(scanned.importItems).map(([_name, { from, import: imports }]) => {
|
|
949
|
+
let fromPath = from;
|
|
947
950
|
if (silgi.options.typescript.removeFileExtension) {
|
|
948
|
-
|
|
951
|
+
fromPath = from.replace(/\.(js|ts|mjs|cjs|jsx|tsx)$/, "");
|
|
949
952
|
}
|
|
950
|
-
return `import { ${imports.map(({ type, name }) => type ? `type ${name}` : name).join(", ")} } from '${
|
|
953
|
+
return `import { ${imports.map(({ type, name }) => type ? `type ${name}` : name).join(", ")} } from '${fromPath}'`;
|
|
951
954
|
}),
|
|
952
955
|
"",
|
|
953
956
|
...scanned.customImports,
|
package/dist/meta/index.d.mts
CHANGED
package/dist/meta/index.d.ts
CHANGED