silgi 0.7.34 → 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.34";
1
+ const version = "0.7.37";
2
2
  const packageJson = {
3
3
  version: version};
4
4
 
@@ -303,7 +303,9 @@ async function resolvePathOptions(options) {
303
303
  throw new Error("Package name is undefined");
304
304
  }
305
305
  options.alias ||= {};
306
+ options.alias[packageJson.name] = join(options.rootDir, "src/module.ts");
306
307
  options.alias[`${packageJson.name}/runtime/`] = join(options.rootDir, "src/runtime/");
308
+ options.alias[`${packageJson.name}/types`] = join(options.rootDir, "src/types");
307
309
  }
308
310
  if (options.stub) {
309
311
  options.alias = {
@@ -603,7 +605,7 @@ async function silgiGenerateType(silgi) {
603
605
  include.add(join(relative2, "dist/runtime"));
604
606
  exclude.add(join(relative2, "dist/runtime/server"));
605
607
  }
606
- const tsConfig = defu(silgi.options.typescript?.tsConfig, {
608
+ const userTsConfig = {
607
609
  compilerOptions: {
608
610
  forceConsistentCasingInFileNames: true,
609
611
  strict: silgi.options.typescript.strict,
@@ -613,10 +615,7 @@ async function silgiGenerateType(silgi) {
613
615
  moduleResolution: "Bundler",
614
616
  allowJs: true,
615
617
  resolveJsonModule: true,
616
- jsx: "preserve",
617
618
  allowSyntheticDefaultImports: true,
618
- jsxFactory: "h",
619
- jsxFragmentFactory: "Fragment",
620
619
  allowImportingTsExtensions: true,
621
620
  customConditions: silgi.options.typescript.customConditions,
622
621
  paths: {
@@ -633,7 +632,6 @@ async function silgiGenerateType(silgi) {
633
632
  if (m.entryPath) {
634
633
  const directory = getDirectory(m.entryPath);
635
634
  acc[`${m.meta.name}/*`] = [`${relativeWithDot(tsconfigDir, directory)}/*`];
636
- acc[`${m.meta.name}/types`] = [`${relativeWithDot(tsconfigDir, join(directory, "types"))}`];
637
635
  }
638
636
  return acc;
639
637
  }, {})
@@ -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.34";
1
+ const version = "0.7.37";
2
2
 
3
3
  export { version };
@@ -1,3 +1,3 @@
1
- const version = "0.7.34";
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.34",
4
+ "version": "0.7.37",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {