silgi 0.18.2 → 0.18.4

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.18.2";
1
+ const version = "0.18.4";
2
2
  const peerDependencies = {
3
3
  "@fastify/deepmerge": "^2.0.2",
4
4
  "@nuxt/kit": "^3.15.3",
@@ -60,16 +60,23 @@ async function silgiGenerateType(silgi) {
60
60
  }
61
61
  const userTsConfig = {
62
62
  compilerOptions: {
63
- forceConsistentCasingInFileNames: true,
64
- strict: silgi.options.typescript.strict,
65
- noEmit: true,
63
+ /* Base options: */
64
+ esModuleInterop: true,
65
+ allowSyntheticDefaultImports: true,
66
+ skipLibCheck: true,
66
67
  target: "ESNext",
67
- module: "ESNext",
68
- moduleResolution: "Bundler",
69
68
  allowJs: true,
70
69
  resolveJsonModule: true,
71
- allowSyntheticDefaultImports: true,
72
- allowImportingTsExtensions: true,
70
+ moduleDetection: "force",
71
+ isolatedModules: true,
72
+ verbatimModuleSyntax: true,
73
+ /* Strictness */
74
+ strict: silgi.options.typescript.strict,
75
+ noUncheckedIndexedAccess: true,
76
+ noImplicitOverride: true,
77
+ forceConsistentCasingInFileNames: true,
78
+ /* If NOT transpiling with TypeScript: */
79
+ module: "Preserve",
73
80
  customConditions: silgi.options.typescript.customConditions,
74
81
  paths: {
75
82
  "#silgiImports": [
@@ -350,7 +350,7 @@ async function loadSilgiModuleInstance(silgiModule) {
350
350
  }
351
351
  return { silgiModule };
352
352
  }
353
- async function installModules(silgi) {
353
+ async function installModules(silgi, prepare = false) {
354
354
  const jiti = createJiti(silgi.options.rootDir, {
355
355
  alias: silgi.options.alias
356
356
  });
@@ -367,19 +367,22 @@ async function installModules(silgi) {
367
367
  silgi.scanModules = silgi.scanModules.filter((m) => m.entryPath !== module.entryPath);
368
368
  continue;
369
369
  }
370
- await installModule(silgiModule, silgi);
370
+ await installModule(silgiModule, silgi, prepare);
371
371
  } catch (err) {
372
372
  silgi.logger.error(err);
373
373
  }
374
374
  }
375
375
  }
376
- async function installModule(moduleToInstall, silgi = useSilgiCLI(), inlineOptions) {
376
+ async function installModule(moduleToInstall, silgi = useSilgiCLI(), inlineOptions, prepare = false) {
377
377
  const { silgiModule } = await loadSilgiModuleInstance(moduleToInstall);
378
- const res = await silgiModule({}, silgi) ?? {};
378
+ const res = await silgiModule(inlineOptions || {}, silgi) ?? {};
379
379
  if (res === false) {
380
380
  return false;
381
381
  }
382
382
  const metaData = await silgiModule.getMeta?.();
383
+ if (prepare) {
384
+ return metaData;
385
+ }
383
386
  const installedModule = silgi.scanModules.find((m) => m.meta.configKey === metaData?.configKey);
384
387
  if (installedModule) {
385
388
  installedModule.installed = true;
@@ -1478,6 +1481,7 @@ async function createSilgiCLI(config = {}, opts = {}) {
1478
1481
  console.error("Please fix type errors before continuing");
1479
1482
  process.exit(1);
1480
1483
  }
1484
+ await installModules(silgi, true);
1481
1485
  await writeScanFiles(silgi);
1482
1486
  silgi.storage = await createStorageCLI(silgi);
1483
1487
  silgi.hooks.hook("close", async () => {
@@ -179,28 +179,6 @@ ${issues.toString()}`);
179
179
  function serviceParseModule(params) {
180
180
  return params;
181
181
  }
182
- const parseGraphQLServices = serviceParseModule(({
183
- node,
184
- basePath,
185
- silgi,
186
- modulesURIs
187
- }) => {
188
- const graphql = node.modules?.graphql;
189
- if (!graphql)
190
- return;
191
- const moduleName = "graphql";
192
- const field = graphql?.field;
193
- if (!field)
194
- return;
195
- modulesURIs[moduleName] ??= {};
196
- if (typeof modulesURIs[moduleName].field === "object" && modulesURIs[moduleName]?.field?.[field]) {
197
- silgi.logger.withTag("handleGraphQLModule").error(
198
- `Hata ${moduleName} ${field} ${basePath} bu zaten burada kullanilmis.`
199
- );
200
- }
201
- modulesURIs[moduleName].field ??= {};
202
- modulesURIs[moduleName].field[field] = basePath;
203
- });
204
182
  const parseRouteRules = serviceParseModule(({
205
183
  node,
206
184
  basePath,
@@ -228,7 +206,6 @@ const parseRouteRules = serviceParseModule(({
228
206
  });
229
207
  function parseServices(silgi, pathLength = [4, 3, 2, 1], servicesObject, currentPath = []) {
230
208
  const modulesURIs = {};
231
- silgi.options.serviceParseModules.push(parseGraphQLServices);
232
209
  silgi.options.serviceParseModules.push(parseRouteRules);
233
210
  const pathLengths = Array.isArray(pathLength) ? pathLength : [pathLength];
234
211
  function traverse(node, path = []) {
@@ -1,4 +1,4 @@
1
- const version = "0.18.2";
1
+ const version = "0.18.4";
2
2
  const peerDependencies = {
3
3
  "@fastify/deepmerge": "^2.0.2",
4
4
  "@nuxt/kit": "^3.15.3",
@@ -1,4 +1,4 @@
1
- const version = "0.18.2";
1
+ const version = "0.18.4";
2
2
  const peerDependencies = {
3
3
  "@fastify/deepmerge": "^2.0.2",
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.18.2",
4
+ "version": "0.18.4",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {