silgi 0.7.35 → 0.7.38
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 +1 -1
- package/dist/cli/types.mjs +46 -6
- package/dist/meta/index.d.mts +1 -1
- package/dist/meta/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/_chunks/index.mjs
CHANGED
package/dist/cli/types.mjs
CHANGED
|
@@ -89,7 +89,7 @@ const SilgiCLIDefaults = {
|
|
|
89
89
|
strict: false,
|
|
90
90
|
generateTsConfig: true,
|
|
91
91
|
// generateRuntimeConfigTypes: true,
|
|
92
|
-
tsconfigPath: "types/silgi.tsconfig.json",
|
|
92
|
+
tsconfigPath: ".silgi/types/silgi.tsconfig.json",
|
|
93
93
|
tsConfig: {},
|
|
94
94
|
customConditions: []
|
|
95
95
|
},
|
|
@@ -305,6 +305,7 @@ async function resolvePathOptions(options) {
|
|
|
305
305
|
options.alias ||= {};
|
|
306
306
|
options.alias[packageJson.name] = join(options.rootDir, "src/module.ts");
|
|
307
307
|
options.alias[`${packageJson.name}/runtime/`] = join(options.rootDir, "src/runtime/");
|
|
308
|
+
options.alias[`${packageJson.name}/types`] = join(options.rootDir, "src/types");
|
|
308
309
|
}
|
|
309
310
|
if (options.stub) {
|
|
310
311
|
options.alias = {
|
|
@@ -604,7 +605,7 @@ async function silgiGenerateType(silgi) {
|
|
|
604
605
|
include.add(join(relative2, "dist/runtime"));
|
|
605
606
|
exclude.add(join(relative2, "dist/runtime/server"));
|
|
606
607
|
}
|
|
607
|
-
const
|
|
608
|
+
const userTsConfig = {
|
|
608
609
|
compilerOptions: {
|
|
609
610
|
forceConsistentCasingInFileNames: true,
|
|
610
611
|
strict: silgi.options.typescript.strict,
|
|
@@ -614,10 +615,7 @@ async function silgiGenerateType(silgi) {
|
|
|
614
615
|
moduleResolution: "Bundler",
|
|
615
616
|
allowJs: true,
|
|
616
617
|
resolveJsonModule: true,
|
|
617
|
-
jsx: "preserve",
|
|
618
618
|
allowSyntheticDefaultImports: true,
|
|
619
|
-
jsxFactory: "h",
|
|
620
|
-
jsxFragmentFactory: "Fragment",
|
|
621
619
|
allowImportingTsExtensions: true,
|
|
622
620
|
customConditions: silgi.options.typescript.customConditions,
|
|
623
621
|
paths: {
|
|
@@ -641,7 +639,49 @@ async function silgiGenerateType(silgi) {
|
|
|
641
639
|
},
|
|
642
640
|
include: [...include],
|
|
643
641
|
exclude: [...exclude]
|
|
644
|
-
}
|
|
642
|
+
};
|
|
643
|
+
const npmPackageTsConfig = {
|
|
644
|
+
compilerOptions: {
|
|
645
|
+
target: "es2022",
|
|
646
|
+
lib: ["es2022", "webworker", "dom.iterable"],
|
|
647
|
+
moduleDetection: "force",
|
|
648
|
+
/* If NOT transpiling with TypeScript: */
|
|
649
|
+
module: "preserve",
|
|
650
|
+
paths: {
|
|
651
|
+
// ...(silgi.scanModules.reduce((acc: Record<string, string[]>, m) => {
|
|
652
|
+
// if (m.entryPath) {
|
|
653
|
+
// const directory = getDirectory(m.entryPath)
|
|
654
|
+
// acc[`${m.meta.name}/*`] = [`${relativeWithDot(tsconfigDir, directory)}/*`]
|
|
655
|
+
// acc[`${m.meta.name}/types`] = [`${relativeWithDot(tsconfigDir, directory)}/types`]
|
|
656
|
+
// }
|
|
657
|
+
// return acc
|
|
658
|
+
// }, {})),
|
|
659
|
+
},
|
|
660
|
+
resolveJsonModule: true,
|
|
661
|
+
allowJs: true,
|
|
662
|
+
/* Strictness */
|
|
663
|
+
strict: true,
|
|
664
|
+
noImplicitOverride: true,
|
|
665
|
+
noEmit: true,
|
|
666
|
+
allowSyntheticDefaultImports: true,
|
|
667
|
+
/* Base options: */
|
|
668
|
+
esModuleInterop: false,
|
|
669
|
+
// TODO: enable noUncheckedIndexedAccess in subsequent PR
|
|
670
|
+
// "noUncheckedIndexedAccess": true,
|
|
671
|
+
forceConsistentCasingInFileNames: true,
|
|
672
|
+
isolatedModules: true,
|
|
673
|
+
verbatimModuleSyntax: true,
|
|
674
|
+
skipLibCheck: true
|
|
675
|
+
},
|
|
676
|
+
// include: ['src', 'test', './moduleTypes.d.ts'],
|
|
677
|
+
// exclude: ['dist', 'examples', 'playground', 'test/fixture'],
|
|
678
|
+
include: [...include],
|
|
679
|
+
exclude: [...exclude]
|
|
680
|
+
};
|
|
681
|
+
const tsConfig = defu(
|
|
682
|
+
silgi.options.typescript?.tsConfig,
|
|
683
|
+
silgi.options.preset === "npm-package" ? npmPackageTsConfig : userTsConfig
|
|
684
|
+
);
|
|
645
685
|
tsConfig.compilerOptions ||= {};
|
|
646
686
|
tsConfig.compilerOptions.paths ||= {};
|
|
647
687
|
tsConfig.include ||= [];
|
package/dist/meta/index.d.mts
CHANGED
package/dist/meta/index.d.ts
CHANGED