@kimesh/kit 0.2.34 → 0.2.35

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.
Files changed (2) hide show
  1. package/dist/index.mjs +45 -26
  2. package/package.json +4 -4
package/dist/index.mjs CHANGED
@@ -2740,7 +2740,24 @@ function resolveLayerAlias(id, layer) {
2740
2740
  basePath = join$1(getLayerSourcePath(layer.path), relativePath);
2741
2741
  }
2742
2742
  if (!basePath) return null;
2743
- if (existsSync(basePath)) return basePath;
2743
+ if (existsSync(basePath)) try {
2744
+ if (statSync(basePath).isDirectory()) {
2745
+ for (const indexFile of [
2746
+ "index.ts",
2747
+ "index.js",
2748
+ "index.vue",
2749
+ "index.mjs",
2750
+ "index.mts"
2751
+ ]) {
2752
+ const indexPath = join$1(basePath, indexFile);
2753
+ if (existsSync(indexPath)) return indexPath;
2754
+ }
2755
+ return basePath;
2756
+ }
2757
+ return basePath;
2758
+ } catch {
2759
+ return basePath;
2760
+ }
2744
2761
  for (const ext of [
2745
2762
  ".ts",
2746
2763
  ".js",
@@ -3551,31 +3568,33 @@ function kimeshPlugin(options = {}) {
3551
3568
  consola.debug(`[Kimesh] Generated layer context types: ${layerContextTypesPath}`);
3552
3569
  }
3553
3570
  const layerTsConfigPath = join$1(layerKimeshDir, "tsconfig.json");
3554
- writeFileSync(layerTsConfigPath, JSON.stringify({
3555
- compilerOptions: {
3556
- target: "ESNext",
3557
- module: "ESNext",
3558
- moduleResolution: "bundler",
3559
- strict: true,
3560
- jsx: "preserve",
3561
- sourceMap: true,
3562
- resolveJsonModule: true,
3563
- esModuleInterop: true,
3564
- lib: ["ESNext", "DOM"],
3565
- skipLibCheck: true,
3566
- noEmit: true,
3567
- baseUrl: "..",
3568
- paths: {
3569
- "~": ["."],
3570
- "~/*": ["./*"],
3571
- "@": ["./src"],
3572
- "@/*": ["./src/*"]
3573
- }
3574
- },
3575
- include: ["../src/**/*", "./**/*"],
3576
- exclude: ["../node_modules"]
3577
- }, null, 2), "utf-8");
3578
- consola.debug(`[Kimesh] Generated layer tsconfig: ${layerTsConfigPath}`);
3571
+ if (!existsSync(layerTsConfigPath)) {
3572
+ writeFileSync(layerTsConfigPath, JSON.stringify({
3573
+ compilerOptions: {
3574
+ target: "ESNext",
3575
+ module: "ESNext",
3576
+ moduleResolution: "bundler",
3577
+ strict: true,
3578
+ jsx: "preserve",
3579
+ sourceMap: true,
3580
+ resolveJsonModule: true,
3581
+ esModuleInterop: true,
3582
+ lib: ["ESNext", "DOM"],
3583
+ skipLibCheck: true,
3584
+ noEmit: true,
3585
+ baseUrl: "..",
3586
+ paths: {
3587
+ "~": ["."],
3588
+ "~/*": ["./*"],
3589
+ "@": ["./src"],
3590
+ "@/*": ["./src/*"]
3591
+ }
3592
+ },
3593
+ include: ["../src/**/*", "./**/*"],
3594
+ exclude: ["../node_modules"]
3595
+ }, null, 2), "utf-8");
3596
+ consola.debug(`[Kimesh] Generated layer tsconfig: ${layerTsConfigPath}`);
3597
+ } else consola.debug(`[Kimesh] Layer tsconfig already exists, skipping: ${layerTsConfigPath}`);
3579
3598
  }
3580
3599
  const htmlPath = join$1(state.generatedDir, "index.html");
3581
3600
  writeFileSync(htmlPath, generateHtml(config.name || "Kimesh App"), "utf-8");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kimesh/kit",
3
- "version": "0.2.34",
3
+ "version": "0.2.35",
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.34",
31
- "@kimesh/layers": "0.2.34",
32
- "@kimesh/router-generator": "0.2.34",
30
+ "@kimesh/auto-import": "0.2.35",
31
+ "@kimesh/layers": "0.2.35",
32
+ "@kimesh/router-generator": "0.2.35",
33
33
  "@vitejs/plugin-vue": "^6.0.3",
34
34
  "c12": "^3.3.3",
35
35
  "consola": "^3.4.2",