silgi 0.35.6 → 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.
@@ -1701,7 +1701,7 @@ async function prepareCoreFile(silgi) {
1701
1701
  ];
1702
1702
  const importData = [
1703
1703
  "",
1704
- "export async function buildSilgi(option: BuildSilgi) {",
1704
+ "export async function buildSilgi(option?: BuildSilgi) {",
1705
1705
  "",
1706
1706
  "// buildSilgiBefore",
1707
1707
  ...before,
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { defineCommand, runMain } from 'citty';
3
3
 
4
- const version = "0.35.6";
4
+ const version = "0.35.8";
5
5
  const packageJson = {
6
6
  version: version};
7
7
 
@@ -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
- const userTsConfig = {
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
- const npmPackageTsConfig = {
684
- compilerOptions: {
685
- target: "es2022",
686
- lib: ["es2022", "webworker", "dom.iterable"],
687
- moduleDetection: "force",
688
- /* If NOT transpiling with TypeScript: */
689
- module: "preserve",
690
- paths: {},
691
- resolveJsonModule: true,
692
- allowJs: true,
693
- /* Strictness */
694
- strict: true,
695
- noImplicitOverride: true,
696
- noEmit: true,
697
- allowSyntheticDefaultImports: true,
698
- /* Base options: */
699
- esModuleInterop: false,
700
- forceConsistentCasingInFileNames: true,
701
- isolatedModules: true,
702
- verbatimModuleSyntax: true,
703
- skipLibCheck: true
704
- },
705
- // include: ['src', 'test', './moduleTypes.d.ts'],
706
- // exclude: ['dist', 'examples', 'playground', 'test/fixture'],
707
- include: [...include],
708
- exclude: [...exclude]
709
- };
710
- const tsConfig = defu(
711
- silgi.options.typescript?.tsConfig,
712
- silgi.options.preset === "npm-package" ? npmPackageTsConfig : userTsConfig
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 ||= [];
@@ -1035,7 +1035,7 @@ interface SilgiConfig extends Partial<Omit<Silgi, 'options'>>, Partial<SilgiRunt
1035
1035
  options: DeepPartial<SilgiOptions>;
1036
1036
  }
1037
1037
  interface BuildSilgi {
1038
- framework: {
1038
+ framework?: {
1039
1039
  nitro?: NitroApp;
1040
1040
  };
1041
1041
  modules?: Partial<SilgiRuntimeOptions>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.35.6",
4
+ "version": "0.35.8",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {