silgi 0.7.35 → 0.7.37

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.7.35";
1
+ const version = "0.7.37";
2
2
  const packageJson = {
3
3
  version: version};
4
4
 
@@ -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 tsConfig = defu(silgi.options.typescript?.tsConfig, {
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 ||= [];
@@ -1,3 +1,3 @@
1
- const version = "0.7.35";
1
+ const version = "0.7.37";
2
2
 
3
3
  export { version };
@@ -1,3 +1,3 @@
1
- const version = "0.7.35";
1
+ const version = "0.7.37";
2
2
 
3
3
  export { version };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.7.35",
4
+ "version": "0.7.37",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {