silgi 0.20.32 → 0.20.33

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.32";
1
+ const version = "0.20.33";
2
2
  const peerDependencies = {
3
3
  "@fastify/deepmerge": "^3.0.0",
4
4
  "@nuxt/kit": "^3.15.3",
@@ -1201,8 +1201,6 @@ class SchemaParser {
1201
1201
  // }
1202
1202
  }
1203
1203
 
1204
- const processedScanItems = /* @__PURE__ */ new Map();
1205
- const processedSchemaItems = /* @__PURE__ */ new Map();
1206
1204
  async function scanFiles$1(silgi, watchFiles) {
1207
1205
  const isWatch = watchFiles && watchFiles.length > 0;
1208
1206
  const filePaths = /* @__PURE__ */ new Set();
@@ -1222,13 +1220,6 @@ async function scanFiles$1(silgi, watchFiles) {
1222
1220
  }
1223
1221
  }
1224
1222
  }
1225
- if (isWatch && watchFiles) {
1226
- for (const file of watchFiles) {
1227
- const filePath = resolve(dir, file);
1228
- processedScanItems.delete(filePath);
1229
- processedSchemaItems.delete(filePath);
1230
- }
1231
- }
1232
1223
  for (const _file of files) {
1233
1224
  const filePath = resolve(dir, _file);
1234
1225
  if (scannedPaths.find((d) => filePath.startsWith(withTrailingSlash(d))) || isIgnored(filePath, silgi)) {
@@ -1308,68 +1299,52 @@ async function scanFiles$1(silgi, watchFiles) {
1308
1299
  }
1309
1300
  silgi.hook("prepare:scan.ts", (options) => {
1310
1301
  for (const { exportName, path, _name, type } of scanTS) {
1311
- const itemKey = `${path}:${exportName}`;
1312
- if (!processedScanItems.has(path)) {
1313
- processedScanItems.set(path, /* @__PURE__ */ new Set());
1302
+ if (type === "service") {
1303
+ options.services.push(_name);
1314
1304
  }
1315
- if (processedScanItems.get(path).has(itemKey)) {
1316
- continue;
1305
+ if (type === "shared") {
1306
+ options.shareds.push(_name);
1317
1307
  }
1318
- processedScanItems.get(path).add(itemKey);
1319
- switch (type) {
1320
- case "service":
1321
- options.services.push(_name);
1322
- break;
1323
- case "shared":
1324
- options.shareds.push(_name);
1325
- break;
1326
- case "schema":
1327
- options.schemas.push(_name);
1328
- break;
1308
+ if (type === "schema") {
1309
+ options.schemas.push(_name);
1329
1310
  }
1330
- addImport(options, path, exportName, _name, silgi.options.silgi.serverDir);
1311
+ options.importItems[path] ??= {
1312
+ import: [],
1313
+ from: relativeWithDot(silgi.options.silgi.serverDir, path)
1314
+ };
1315
+ options.importItems[path].import.push({
1316
+ name: `${exportName} as ${_name}`,
1317
+ key: _name
1318
+ });
1331
1319
  }
1332
1320
  });
1333
1321
  silgi.hook("prepare:schema.ts", (options) => {
1334
1322
  for (const { exportName, path, _name, type } of schemaTS) {
1335
- const itemKey = `${path}:${exportName}`;
1336
- if (!processedSchemaItems.has(path)) {
1337
- processedSchemaItems.set(path, /* @__PURE__ */ new Set());
1338
- }
1339
- if (processedSchemaItems.get(path).has(itemKey)) {
1340
- continue;
1341
- }
1342
- processedSchemaItems.get(path).add(itemKey);
1343
1323
  if (type === "shared") {
1344
1324
  options.shareds.push({
1345
1325
  key: _name,
1346
1326
  value: _name
1347
1327
  });
1348
- } else if (type === "context") {
1328
+ }
1329
+ if (type === "context") {
1349
1330
  options.contexts.push({
1350
1331
  key: _name,
1351
1332
  value: _name
1352
1333
  });
1353
1334
  }
1354
- addImport(options, path, exportName, _name, silgi.options.silgi.serverDir);
1335
+ options.importItems[path] ??= {
1336
+ import: [],
1337
+ from: relativeWithDot(silgi.options.silgi.serverDir, path)
1338
+ };
1339
+ options.importItems[path].import.push({
1340
+ name: `${exportName} as ${_name}`,
1341
+ key: _name
1342
+ });
1355
1343
  }
1356
1344
  });
1357
1345
  }
1358
1346
  }
1359
1347
  }
1360
- function addImport(options, path, exportName, _name, serverDir) {
1361
- const existingItem = options.importItems[path]?.import.find((item) => item.key === _name);
1362
- if (existingItem)
1363
- return;
1364
- options.importItems[path] ??= {
1365
- import: [],
1366
- from: relativeWithDot(serverDir, path)
1367
- };
1368
- options.importItems[path].import.push({
1369
- name: `${exportName} as ${_name}`,
1370
- key: _name
1371
- });
1372
- }
1373
1348
 
1374
1349
  async function createStorageCLI(silgi) {
1375
1350
  const storage = createStorage();
@@ -1,4 +1,4 @@
1
- const version = "0.20.32";
1
+ const version = "0.20.33";
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.32";
1
+ const version = "0.20.33";
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.32",
4
+ "version": "0.20.33",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {