@kimesh/kit 0.2.29 → 0.2.30

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/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Hookable } from "hookable";
2
2
  import { Ignore } from "ignore";
3
- import * as vite0 from "vite";
3
+ import * as vite3 from "vite";
4
4
  import { Plugin, Plugin as VitePlugin, PluginOption, PluginOption as VitePluginOption, ResolvedConfig, UserConfig, ViteDevServer } from "vite";
5
5
  import { KimeshLayerConfig, LayerAutoImportConfig, LayerComponentConfig, LayerComposableConfig, LayerRouteConfig, ResolvedLayer, ResolvedLayer as ResolvedLayer$1, generateLayerAliases, mergeLayerConfigs, prepareLayers, resolveLayers } from "@kimesh/layers";
6
6
  import { AutoImportConfig, ImportPreset, LayerAutoImportSource as ImportSource, buildImportRegistry, generateDts, kimeshAutoImport, scanExports } from "@kimesh/auto-import";
@@ -158,7 +158,7 @@ interface KimeshHooks {
158
158
  /** Called to extend Vite config before it's resolved */
159
159
  'vite:extend': (ctx: {
160
160
  kimesh: Kimesh;
161
- config: vite0.UserConfig;
161
+ config: vite3.UserConfig;
162
162
  }) => HookResult;
163
163
  /** Called after Vite config is resolved */
164
164
  'vite:configResolved': (config: ResolvedConfig, kimesh: Kimesh) => HookResult;
@@ -523,7 +523,7 @@ interface KimeshPluginDefinition {
523
523
  * Setup function that returns Vite plugin(s)
524
524
  * @param kimesh - Kimesh context
525
525
  */
526
- setup: (kimesh: Kimesh) => vite0.PluginOption | vite0.PluginOption[];
526
+ setup: (kimesh: Kimesh) => vite3.PluginOption | vite3.PluginOption[];
527
527
  }
528
528
  interface KimeshPlugin {
529
529
  /** Plugin definition */
@@ -531,7 +531,7 @@ interface KimeshPlugin {
531
531
  /** Plugin name */
532
532
  name: string;
533
533
  /** Get Vite plugins */
534
- getPlugins: (kimesh: Kimesh) => vite0.PluginOption[];
534
+ getPlugins: (kimesh: Kimesh) => vite3.PluginOption[];
535
535
  }
536
536
  //#endregion
537
537
  //#region src/types/config.d.ts
@@ -2415,7 +2415,7 @@ interface KimeshPluginOptions {
2415
2415
  /**
2416
2416
  * Additional Vite plugins added programmatically.
2417
2417
  */
2418
- additionalPlugins?: vite0.PluginOption[];
2418
+ additionalPlugins?: vite3.PluginOption[];
2419
2419
  }
2420
2420
  //#endregion
2421
2421
  export { type AddRuntimePluginOptions, type AutoImportConfig, type AutoImportOptions, type ComponentsConfig, DEFAULT_ALIASES, DEFAULT_IGNORE_PATTERNS, type DebugConfig, type DiscoveredPlugin, type EnvOptions, type ErrorContext, type FormattedError, type GeneratePluginsTemplateOptions, type HMRContext, type HMRWatcherOptions, type HookResult, INTERNAL_ALIASES, type IgnoreOptions, type ImportPreset, type ImportSource, type InternalAliasConfig, type Kimesh, type KimeshAlias, type KimeshAppContext, type KimeshComponent, type KimeshComponentsDir, type KimeshConfig, type KimeshHooks, type KimeshImport, type KimeshImportPreset, type KimeshImportsDir, type KimeshLayerConfig, type KimeshModule, type KimeshModuleDefaults, type KimeshModuleDefinition, type KimeshModuleInput, type KimeshModuleMeta, type KimeshModuleOptions, type KimeshOptions, type KimeshPlugin, type KimeshPluginDefinition, KimeshPluginOptions, type KimeshRegistries, type KimeshResolver, type KimeshRoute, type KimeshRouteMiddleware, type KimeshRuntimeHooks, type KimeshRuntimePlugin, type KimeshRuntimePluginDefinition, type KimeshRuntimePluginEntry, type KimeshRuntimePluginMeta, type KimeshRuntimePluginResult, type KimeshTemplate, type KimeshTypeTemplate, type KimeshViteConfig, type KimeshVitePluginEntry, type LayerAutoImportConfig, type LayerComponentConfig, type LayerComposableConfig, type LayerRouteConfig, type LayersConfig, type LoadConfigOptions, type PrepareOptions, type PrepareResult, type ResolvedLayer, type ResolvedTemplate, type RouteRule, type RuntimeConfig, type RuntimeConfigPublic, type ScanPluginsOptions, type VitePlugin, type VitePluginOption, addAlias, addBuildPlugin, addComponent, addComponentResolver, addComponentsDir, addImports, addImportsDir, addImportsPreset, addInternalAliasTemplates, addPluginsTemplate, addRuntimePlugin, addTemplate, addTypeTemplate, addVitePlugin, applyEnv, buildAliases, buildImportRegistry, buildInternalAliasMap, createDebugLogger, createDefaultRuntimeConfig, createHMRWatcher, createIgnoreFilter, createIgnoreMatcher, createKimesh, createResolver, createTimer, debug, debugTable, defineKimeshModule, defineKimeshPlugin, defineKmConfig, envToKey, executeModule, executeModules, filterIgnored, findMatchingRules, formatConflictWarning, formatError, formatTiming, formatWarning, generateDts, generateInternalAliasTemplate, generateLayerAliases, generatePluginsTemplate, generateRouteRulesManifest, getIgnorePatterns, getRedirectInfo, getRouteRule, getRuntimePlugins, hasPlugins, hasRuntimePlugin, isDebug, isDebugEnabled, keyToEnv, kimeshAutoImport, kimeshPlugin, loadConfig, matchRoutePattern, mergeLayerConfigs, mergeRouteRules, normalizeDebugConfig, normalizeModuleInput, prepare, prepareLayers, removeRuntimePlugin, resolveAlias, resolveAliasPath, resolveLayers, resolvePathFromBuild, resolvePathFromRoot, scanExports, scanPluginsDir, setDebugConfig, shouldIgnore, toTsConfigPaths, toViteAliases, tryUseKimesh, updateTemplates, useKimesh, writeTemplates };
package/dist/index.mjs CHANGED
@@ -1799,10 +1799,9 @@ function debugTable(title, data) {
1799
1799
  * @returns TSConfig JSON object
1800
1800
  */
1801
1801
  function generateTsConfig(options) {
1802
- const { rootDir, buildDir, aliases, layerAliases = {}, moduleAliases = {}, internalAliases = {}, include = ["../src/**/*", "./**/*"] } = options;
1802
+ const { rootDir, srcDir, buildDir, aliases, moduleAliases = {}, internalAliases = {}, include = ["../src/**/*", "./**/*"] } = options;
1803
1803
  const allAliases = {
1804
1804
  ...aliases,
1805
- ...layerAliases,
1806
1805
  ...moduleAliases,
1807
1806
  ...internalAliases
1808
1807
  };
@@ -1813,6 +1812,12 @@ function generateTsConfig(options) {
1813
1812
  paths[alias] = [normalizedPath];
1814
1813
  paths[`${alias}/*`] = [`${normalizedPath}/*`];
1815
1814
  }
1815
+ const srcRelativePath = relative(buildDir, srcDir);
1816
+ const normalizedSrcPath = srcRelativePath.startsWith("..") ? srcRelativePath : "./" + srcRelativePath;
1817
+ paths["~"] = [normalizedSrcPath];
1818
+ paths["~/*"] = [`${normalizedSrcPath}/*`];
1819
+ paths["@"] = [normalizedSrcPath];
1820
+ paths["@/*"] = [`${normalizedSrcPath}/*`];
1816
1821
  for (const pkg of [
1817
1822
  "@kimesh/router-runtime",
1818
1823
  "@kimesh/kit",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kimesh/kit",
3
- "version": "0.2.29",
3
+ "version": "0.2.30",
4
4
  "description": "Build-time engine for Kimesh framework",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,9 +27,9 @@
27
27
  "test:watch": "vitest"
28
28
  },
29
29
  "dependencies": {
30
- "@kimesh/auto-import": "0.2.29",
31
- "@kimesh/layers": "0.2.29",
32
- "@kimesh/router-generator": "0.2.29",
30
+ "@kimesh/auto-import": "0.2.30",
31
+ "@kimesh/layers": "0.2.30",
32
+ "@kimesh/router-generator": "0.2.30",
33
33
  "@vitejs/plugin-vue": "^6.0.3",
34
34
  "c12": "^3.3.3",
35
35
  "consola": "^3.4.2",