silgi 0.35.7 → 0.35.8
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/cli/index.mjs +1 -1
- package/dist/cli/types.mjs +42 -34
- package/package.json +1 -1
package/dist/cli/index.mjs
CHANGED
package/dist/cli/types.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import escapeRE from 'escape-string-regexp';
|
|
|
9
9
|
import { resolveModuleExportNames } from 'mlly';
|
|
10
10
|
import { existsSync, promises, lstatSync } from 'node:fs';
|
|
11
11
|
import { findWorkspaceDir, readPackageJSON } from 'pkg-types';
|
|
12
|
-
import { resolveSilgiPath, relativeWithDot, resolveSilgiModule } from 'silgi/kit';
|
|
12
|
+
import { resolveSilgiPath, relativeWithDot, resolveSilgiModule, isPresents } from 'silgi/kit';
|
|
13
13
|
import { runtimeDir, pkgDir } from 'silgi/runtime/meta';
|
|
14
14
|
import { withLeadingSlash, withTrailingSlash } from 'ufo';
|
|
15
15
|
import { defu } from 'defu';
|
|
@@ -636,7 +636,8 @@ async function silgiGenerateType(silgi) {
|
|
|
636
636
|
include.add(join(relative2, "dist/runtime"));
|
|
637
637
|
exclude.add(join(relative2, "dist/runtime/server"));
|
|
638
638
|
}
|
|
639
|
-
|
|
639
|
+
let tsConfig = silgi.options.typescript?.tsConfig;
|
|
640
|
+
const defaultConfig = defu(tsConfig, {
|
|
640
641
|
compilerOptions: {
|
|
641
642
|
/* Base options: */
|
|
642
643
|
esModuleInterop: true,
|
|
@@ -655,6 +656,7 @@ async function silgiGenerateType(silgi) {
|
|
|
655
656
|
noUncheckedIndexedAccess: true,
|
|
656
657
|
noImplicitOverride: true,
|
|
657
658
|
forceConsistentCasingInFileNames: true,
|
|
659
|
+
noEmit: true,
|
|
658
660
|
/* If NOT transpiling with TypeScript: */
|
|
659
661
|
module: "Preserve",
|
|
660
662
|
customConditions: silgi.options.typescript.customConditions,
|
|
@@ -679,38 +681,44 @@ async function silgiGenerateType(silgi) {
|
|
|
679
681
|
},
|
|
680
682
|
include: [...include],
|
|
681
683
|
exclude: [...exclude]
|
|
682
|
-
};
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
684
|
+
});
|
|
685
|
+
if (isPresents(["hono"])) {
|
|
686
|
+
tsConfig = defu(defaultConfig, {
|
|
687
|
+
compilerOptions: {
|
|
688
|
+
jsx: "react-jsx",
|
|
689
|
+
jsxImportSource: "hono/jsx"
|
|
690
|
+
}
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
|
+
if (isPresents(["npm-package"])) {
|
|
694
|
+
tsConfig = defu(tsConfig, {
|
|
695
|
+
compilerOptions: {
|
|
696
|
+
target: "es2022",
|
|
697
|
+
lib: ["es2022", "webworker", "dom.iterable"],
|
|
698
|
+
moduleDetection: "force",
|
|
699
|
+
/* If NOT transpiling with TypeScript: */
|
|
700
|
+
module: "preserve",
|
|
701
|
+
paths: {},
|
|
702
|
+
resolveJsonModule: true,
|
|
703
|
+
allowJs: true,
|
|
704
|
+
/* Strictness */
|
|
705
|
+
strict: true,
|
|
706
|
+
noImplicitOverride: true,
|
|
707
|
+
noEmit: true,
|
|
708
|
+
allowSyntheticDefaultImports: true,
|
|
709
|
+
/* Base options: */
|
|
710
|
+
esModuleInterop: false,
|
|
711
|
+
forceConsistentCasingInFileNames: true,
|
|
712
|
+
isolatedModules: true,
|
|
713
|
+
verbatimModuleSyntax: true,
|
|
714
|
+
skipLibCheck: true
|
|
715
|
+
},
|
|
716
|
+
// include: ['src', 'test', './moduleTypes.d.ts'],
|
|
717
|
+
// exclude: ['dist', 'examples', 'playground', 'test/fixture'],
|
|
718
|
+
include: [...include],
|
|
719
|
+
exclude: [...exclude]
|
|
720
|
+
});
|
|
721
|
+
}
|
|
714
722
|
tsConfig.compilerOptions ||= {};
|
|
715
723
|
tsConfig.compilerOptions.paths ||= {};
|
|
716
724
|
tsConfig.include ||= [];
|