@kimesh/kit 0.2.32 → 0.2.33-nightly.20260129030609
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 +5 -5
- package/dist/index.mjs +53 -5
- package/package.json +4 -4
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
|
|
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:
|
|
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) =>
|
|
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) =>
|
|
534
|
+
getPlugins: (kimesh: Kimesh) => vite3.PluginOption[];
|
|
535
535
|
}
|
|
536
536
|
//#endregion
|
|
537
537
|
//#region src/types/config.d.ts
|
|
@@ -2418,7 +2418,7 @@ interface KimeshPluginOptions {
|
|
|
2418
2418
|
/**
|
|
2419
2419
|
* Additional Vite plugins added programmatically.
|
|
2420
2420
|
*/
|
|
2421
|
-
additionalPlugins?:
|
|
2421
|
+
additionalPlugins?: vite3.PluginOption[];
|
|
2422
2422
|
}
|
|
2423
2423
|
//#endregion
|
|
2424
2424
|
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
|
@@ -5,7 +5,7 @@ import { klona } from "klona/json";
|
|
|
5
5
|
import destr from "destr";
|
|
6
6
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
7
7
|
import consola from "consola";
|
|
8
|
-
import { existsSync, mkdirSync, readFileSync, realpathSync, writeFileSync } from "node:fs";
|
|
8
|
+
import { existsSync, mkdirSync, readFileSync, realpathSync, statSync, writeFileSync } from "node:fs";
|
|
9
9
|
import { dirname, isAbsolute, join, resolve } from "node:path";
|
|
10
10
|
import fg from "fast-glob";
|
|
11
11
|
import { basename, dirname as dirname$1, extname, isAbsolute as isAbsolute$1, join as join$1, normalize, relative, resolve as resolve$1 } from "pathe";
|
|
@@ -1840,6 +1840,32 @@ function generateTsConfig(options) {
|
|
|
1840
1840
|
}
|
|
1841
1841
|
}
|
|
1842
1842
|
const kimeshDir = resolvePackageDir("kimesh", rootDir);
|
|
1843
|
+
if (kimeshDir) {
|
|
1844
|
+
const relativeKimeshPath = relative(buildDir, kimeshDir);
|
|
1845
|
+
const normalizedKimeshPath = relativeKimeshPath.startsWith("..") ? relativeKimeshPath : "./" + relativeKimeshPath;
|
|
1846
|
+
for (const { subpath } of [
|
|
1847
|
+
{
|
|
1848
|
+
subpath: "router-runtime",
|
|
1849
|
+
distFile: "dist/router-runtime.d.ts"
|
|
1850
|
+
},
|
|
1851
|
+
{
|
|
1852
|
+
subpath: "kit",
|
|
1853
|
+
distFile: "dist/kit.d.ts"
|
|
1854
|
+
},
|
|
1855
|
+
{
|
|
1856
|
+
subpath: "query",
|
|
1857
|
+
distFile: "dist/query.d.ts"
|
|
1858
|
+
},
|
|
1859
|
+
{
|
|
1860
|
+
subpath: "head",
|
|
1861
|
+
distFile: "dist/head.d.ts"
|
|
1862
|
+
},
|
|
1863
|
+
{
|
|
1864
|
+
subpath: "config",
|
|
1865
|
+
distFile: "dist/config.d.ts"
|
|
1866
|
+
}
|
|
1867
|
+
]) paths[`kimesh/${subpath}`] = [`${normalizedKimeshPath}/dist/${subpath}.d.ts`];
|
|
1868
|
+
}
|
|
1843
1869
|
let viteClientDtsPath;
|
|
1844
1870
|
if (kimeshDir) {
|
|
1845
1871
|
const viteDir = resolvePackageDir("vite", kimeshDir);
|
|
@@ -2775,7 +2801,21 @@ function layerAliasPlugin(options) {
|
|
|
2775
2801
|
if (aliasKey && moduleAliases[aliasKey]) {
|
|
2776
2802
|
const relativePath = id.slice(2);
|
|
2777
2803
|
const resolved = join$1(moduleAliases[aliasKey], relativePath);
|
|
2778
|
-
if (existsSync(resolved))
|
|
2804
|
+
if (existsSync(resolved)) {
|
|
2805
|
+
try {
|
|
2806
|
+
if (statSync(resolved).isDirectory()) for (const indexFile of [
|
|
2807
|
+
"index.ts",
|
|
2808
|
+
"index.js",
|
|
2809
|
+
"index.vue",
|
|
2810
|
+
"index.mjs",
|
|
2811
|
+
"index.mts"
|
|
2812
|
+
]) {
|
|
2813
|
+
const indexPath = join$1(resolved, indexFile);
|
|
2814
|
+
if (existsSync(indexPath)) return indexPath;
|
|
2815
|
+
}
|
|
2816
|
+
} catch {}
|
|
2817
|
+
return resolved;
|
|
2818
|
+
}
|
|
2779
2819
|
for (const ext of [
|
|
2780
2820
|
".ts",
|
|
2781
2821
|
".js",
|
|
@@ -2788,6 +2828,16 @@ function layerAliasPlugin(options) {
|
|
|
2788
2828
|
const withExt = resolved + ext;
|
|
2789
2829
|
if (existsSync(withExt)) return withExt;
|
|
2790
2830
|
}
|
|
2831
|
+
for (const indexFile of [
|
|
2832
|
+
"index.ts",
|
|
2833
|
+
"index.js",
|
|
2834
|
+
"index.vue",
|
|
2835
|
+
"index.mjs",
|
|
2836
|
+
"index.mts"
|
|
2837
|
+
]) {
|
|
2838
|
+
const indexPath = join$1(resolved, indexFile);
|
|
2839
|
+
if (existsSync(indexPath)) return indexPath;
|
|
2840
|
+
}
|
|
2791
2841
|
return resolved;
|
|
2792
2842
|
}
|
|
2793
2843
|
}
|
|
@@ -3922,9 +3972,7 @@ declare global {
|
|
|
3922
3972
|
const watchEffect: typeof import('vue')['watchEffect']
|
|
3923
3973
|
const onMounted: typeof import('vue')['onMounted']
|
|
3924
3974
|
const onUnmounted: typeof import('vue')['onUnmounted']
|
|
3925
|
-
|
|
3926
|
-
const defineEmits: typeof import('vue')['defineEmits']
|
|
3927
|
-
const withDefaults: typeof import('vue')['withDefaults']
|
|
3975
|
+
// Note: defineProps, defineEmits, withDefaults are compiler macros and should not be auto-imported
|
|
3928
3976
|
|
|
3929
3977
|
// Vue Router imports
|
|
3930
3978
|
const useRoute: typeof import('vue-router')['useRoute']
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kimesh/kit",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.33-nightly.20260129030609",
|
|
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": "
|
|
31
|
-
"@kimesh/layers": "
|
|
32
|
-
"@kimesh/router-generator": "
|
|
30
|
+
"@kimesh/auto-import": "workspace:*",
|
|
31
|
+
"@kimesh/layers": "workspace:*",
|
|
32
|
+
"@kimesh/router-generator": "workspace:*",
|
|
33
33
|
"@vitejs/plugin-vue": "^6.0.3",
|
|
34
34
|
"c12": "^3.3.3",
|
|
35
35
|
"consola": "^3.4.2",
|