silgi 0.8.31 → 0.8.32

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.8.31";
1
+ const version = "0.8.32";
2
2
  const devDependencies = {
3
3
  "@antfu/eslint-config": "^4.2.0",
4
4
  "@fastify/deepmerge": "^2.0.2",
@@ -1413,8 +1413,10 @@ async function scanFiles$1(silgi) {
1413
1413
  if (createServices.length > 0) {
1414
1414
  for (const createService of createServices) {
1415
1415
  const { exportName, path } = createService;
1416
+ const randomString = hash(basename(path) + exportName);
1417
+ const _name = `_v${randomString}`;
1416
1418
  silgi.hook("prepare:core.ts", (options) => {
1417
- options.services.push(exportName);
1419
+ options.services.push(_name);
1418
1420
  });
1419
1421
  silgi.hook("prepare:core.ts", (options) => {
1420
1422
  options.importItems[path] ??= {
@@ -1422,7 +1424,7 @@ async function scanFiles$1(silgi) {
1422
1424
  from: relativeWithDot(silgi.options.silgi.serverDir, path)
1423
1425
  };
1424
1426
  options.importItems[path].import.push({
1425
- name: exportName
1427
+ name: `${exportName} as ${_name}`
1426
1428
  });
1427
1429
  });
1428
1430
  }
@@ -1431,8 +1433,10 @@ async function scanFiles$1(silgi) {
1431
1433
  if (createSchemas.length > 0) {
1432
1434
  for (const createSchema of createSchemas) {
1433
1435
  const { exportName, path } = createSchema;
1436
+ const randomString = hash(basename(path) + exportName);
1437
+ const _name = `_v${randomString}`;
1434
1438
  silgi.hook("prepare:core.ts", (options) => {
1435
- options.schemas.push(exportName);
1439
+ options.schemas.push(_name);
1436
1440
  });
1437
1441
  silgi.hook("prepare:core.ts", (options) => {
1438
1442
  options.importItems[path] ??= {
@@ -1440,7 +1444,7 @@ async function scanFiles$1(silgi) {
1440
1444
  from: relativeWithDot(silgi.options.silgi.serverDir, path)
1441
1445
  };
1442
1446
  options.importItems[path].import.push({
1443
- name: exportName
1447
+ name: `${exportName} as ${_name}`
1444
1448
  });
1445
1449
  });
1446
1450
  }
@@ -1449,8 +1453,10 @@ async function scanFiles$1(silgi) {
1449
1453
  if (createShareds.length > 0) {
1450
1454
  for (const createShared of createShareds) {
1451
1455
  const { exportName, path } = createShared;
1456
+ const randomString = hash(basename(path) + exportName);
1457
+ const _name = `_v${randomString}`;
1452
1458
  silgi.hook("prepare:core.ts", (options) => {
1453
- options.shareds.push(exportName);
1459
+ options.shareds.push(_name);
1454
1460
  });
1455
1461
  silgi.hook("prepare:core.ts", (options) => {
1456
1462
  options.importItems[path] ??= {
@@ -1459,7 +1465,7 @@ async function scanFiles$1(silgi) {
1459
1465
  from: relativeWithDot(silgi.options.silgi.serverDir, path)
1460
1466
  };
1461
1467
  options.importItems[path].import.push({
1462
- name: exportName
1468
+ name: `${exportName} as ${_name}`
1463
1469
  });
1464
1470
  });
1465
1471
  }
@@ -1468,10 +1474,12 @@ async function scanFiles$1(silgi) {
1468
1474
  if (sharedsTypes.length > 0) {
1469
1475
  for (const sharedType of sharedsTypes) {
1470
1476
  const { exportName, path } = sharedType;
1477
+ const randomString = hash(basename(path) + exportName);
1478
+ const _name = `_v${randomString}`;
1471
1479
  silgi.hook("prepare:schema.ts", (options) => {
1472
1480
  options.shareds.push({
1473
- key: exportName,
1474
- value: exportName
1481
+ key: _name,
1482
+ value: _name
1475
1483
  });
1476
1484
  });
1477
1485
  silgi.hook("prepare:schema.ts", (options) => {
@@ -1480,7 +1488,7 @@ async function scanFiles$1(silgi) {
1480
1488
  from: path
1481
1489
  };
1482
1490
  options.importItems[path].import.push({
1483
- name: exportName,
1491
+ name: `${exportName} as ${_name}`,
1484
1492
  type: true
1485
1493
  });
1486
1494
  });
@@ -1490,10 +1498,12 @@ async function scanFiles$1(silgi) {
1490
1498
  if (contextTypes.length > 0) {
1491
1499
  for (const contextType of contextTypes) {
1492
1500
  const { exportName, path } = contextType;
1501
+ const randomString = hash(basename(path) + exportName);
1502
+ const _name = `_v${randomString}`;
1493
1503
  silgi.hook("prepare:schema.ts", (options) => {
1494
1504
  options.contexts.push({
1495
- key: exportName,
1496
- value: exportName
1505
+ key: _name,
1506
+ value: _name
1497
1507
  });
1498
1508
  });
1499
1509
  silgi.hook("prepare:schema.ts", (options) => {
@@ -1502,7 +1512,7 @@ async function scanFiles$1(silgi) {
1502
1512
  from: path
1503
1513
  };
1504
1514
  options.importItems[path].import.push({
1505
- name: exportName,
1515
+ name: `${exportName} as ${_name}`,
1506
1516
  type: true
1507
1517
  });
1508
1518
  });
@@ -1,4 +1,4 @@
1
- const version = "0.8.31";
1
+ const version = "0.8.32";
2
2
  const devDependencies = {
3
3
  "@antfu/eslint-config": "^4.2.0",
4
4
  "@fastify/deepmerge": "^2.0.2",
@@ -1,4 +1,4 @@
1
- const version = "0.8.31";
1
+ const version = "0.8.32";
2
2
  const devDependencies = {
3
3
  "@antfu/eslint-config": "^4.2.0",
4
4
  "@fastify/deepmerge": "^2.0.2",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.8.31",
4
+ "version": "0.8.32",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {