silgi 0.18.3 → 0.18.5
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
CHANGED
package/dist/cli/types.mjs
CHANGED
|
@@ -60,16 +60,23 @@ async function silgiGenerateType(silgi) {
|
|
|
60
60
|
}
|
|
61
61
|
const userTsConfig = {
|
|
62
62
|
compilerOptions: {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
|
|
72
|
-
|
|
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,10 @@ 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
|
+
if (prepare) {
|
|
355
|
+
silgi.options.isPreparingModules = true;
|
|
356
|
+
}
|
|
354
357
|
const jiti = createJiti(silgi.options.rootDir, {
|
|
355
358
|
alias: silgi.options.alias
|
|
356
359
|
});
|
|
@@ -367,19 +370,25 @@ async function installModules(silgi) {
|
|
|
367
370
|
silgi.scanModules = silgi.scanModules.filter((m) => m.entryPath !== module.entryPath);
|
|
368
371
|
continue;
|
|
369
372
|
}
|
|
370
|
-
await installModule(silgiModule, silgi);
|
|
373
|
+
await installModule(silgiModule, silgi, prepare);
|
|
371
374
|
} catch (err) {
|
|
372
375
|
silgi.logger.error(err);
|
|
373
376
|
}
|
|
374
377
|
}
|
|
378
|
+
if (prepare) {
|
|
379
|
+
silgi.options.isPreparingModules = false;
|
|
380
|
+
}
|
|
375
381
|
}
|
|
376
|
-
async function installModule(moduleToInstall, silgi = useSilgiCLI(), inlineOptions) {
|
|
382
|
+
async function installModule(moduleToInstall, silgi = useSilgiCLI(), inlineOptions, prepare = false) {
|
|
377
383
|
const { silgiModule } = await loadSilgiModuleInstance(moduleToInstall);
|
|
378
|
-
const res = await silgiModule({}, silgi) ?? {};
|
|
384
|
+
const res = await silgiModule(inlineOptions || {}, silgi) ?? {};
|
|
379
385
|
if (res === false) {
|
|
380
386
|
return false;
|
|
381
387
|
}
|
|
382
388
|
const metaData = await silgiModule.getMeta?.();
|
|
389
|
+
if (prepare) {
|
|
390
|
+
return metaData;
|
|
391
|
+
}
|
|
383
392
|
const installedModule = silgi.scanModules.find((m) => m.meta.configKey === metaData?.configKey);
|
|
384
393
|
if (installedModule) {
|
|
385
394
|
installedModule.installed = true;
|
|
@@ -1478,6 +1487,7 @@ async function createSilgiCLI(config = {}, opts = {}) {
|
|
|
1478
1487
|
console.error("Please fix type errors before continuing");
|
|
1479
1488
|
process.exit(1);
|
|
1480
1489
|
}
|
|
1490
|
+
await installModules(silgi, true);
|
|
1481
1491
|
await writeScanFiles(silgi);
|
|
1482
1492
|
silgi.storage = await createStorageCLI(silgi);
|
|
1483
1493
|
silgi.hooks.hook("close", async () => {
|
package/dist/meta/index.d.mts
CHANGED
package/dist/meta/index.d.ts
CHANGED
package/dist/types/index.d.mts
CHANGED
|
@@ -590,6 +590,7 @@ interface SilgiCLIOptions extends PresetOptions {
|
|
|
590
590
|
compatibilityDate: CompatibilityDates;
|
|
591
591
|
modules: (SilgiModule<any> | string | [SilgiModule | string, Record<string, any>] | undefined | null | false)[];
|
|
592
592
|
_modules: (SilgiModule<any> | string | [SilgiModule | string, Record<string, any>] | undefined | null | false)[];
|
|
593
|
+
isPreparingModules: boolean;
|
|
593
594
|
debug: boolean;
|
|
594
595
|
preset: PresetName;
|
|
595
596
|
static: boolean;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -590,6 +590,7 @@ interface SilgiCLIOptions extends PresetOptions {
|
|
|
590
590
|
compatibilityDate: CompatibilityDates;
|
|
591
591
|
modules: (SilgiModule<any> | string | [SilgiModule | string, Record<string, any>] | undefined | null | false)[];
|
|
592
592
|
_modules: (SilgiModule<any> | string | [SilgiModule | string, Record<string, any>] | undefined | null | false)[];
|
|
593
|
+
isPreparingModules: boolean;
|
|
593
594
|
debug: boolean;
|
|
594
595
|
preset: PresetName;
|
|
595
596
|
static: boolean;
|