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.
@@ -1,4 +1,4 @@
1
- const version = "0.20.24";
1
+ const version = "0.20.25";
2
2
  const peerDependencies = {
3
3
  "@fastify/deepmerge": "^3.0.0",
4
4
  "@nuxt/kit": "^3.15.3",
@@ -903,7 +903,7 @@ async function prepareServerFiles(silgi) {
903
903
  from: "./configs.ts"
904
904
  }
905
905
  };
906
- const createScannedObject = () => ({
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
- defu$1(scanned.uris, silgi.uris);
920
+ scanned.uris = { ...silgi.uris };
922
921
  }
923
922
  if (silgi.modulesURIs) {
924
- defu$1(scanned.modulesURIs, silgi.modulesURIs);
923
+ scanned.modulesURIs = { ...silgi.modulesURIs };
925
924
  }
926
- await silgi.callHook("prepare:scan.ts", scanned);
927
- if (scanned.importItems["#silgi/vfs"].import.length === 0) {
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
- from = from.replace(/\.(js|ts|mjs|cjs|jsx|tsx)$/, "");
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 '${from}'`;
953
+ return `import { ${imports.map(({ type, name }) => type ? `type ${name}` : name).join(", ")} } from '${fromPath}'`;
951
954
  }),
952
955
  "",
953
956
  ...scanned.customImports,
@@ -1,4 +1,4 @@
1
- const version = "0.20.24";
1
+ const version = "0.20.25";
2
2
  const peerDependencies = {
3
3
  "@fastify/deepmerge": "^3.0.0",
4
4
  "@nuxt/kit": "^3.15.3",
@@ -1,4 +1,4 @@
1
- const version = "0.20.24";
1
+ const version = "0.20.25";
2
2
  const peerDependencies = {
3
3
  "@fastify/deepmerge": "^3.0.0",
4
4
  "@nuxt/kit": "^3.15.3",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.20.24",
4
+ "version": "0.20.25",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {