@vixt/core 0.5.5 → 0.5.7

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.
@@ -176,13 +176,7 @@ declare function generateCss(options: AppOptions): string;
176
176
 
177
177
  declare function generateIndexHtml(options: AppOptions, vixt: Vixt): string;
178
178
 
179
- /**
180
- * compatible unocss v66.0.0 to vite v7.0.0
181
- * `[unocss:global:build:scan] cssPlugins.get(...).transform.call is not a function`
182
- */
183
- declare function patchUnocss(): void;
184
-
185
179
  declare function generatePlugins(vixt: Vixt): string;
186
180
 
187
- export { applyLayerModules, applyLayers, config, createVixtPlugin, defineVitePlugin, defineVixtConfig, defineVixtModule, findUpWorkspaceDir, generateAppConfig, generateClient, generateCss, generateIndexHtml, generatePlugins, installModule, isSamePath, loadEnv, loadVixt, loadVixtConfig, loadWorkspaceEnv, patchUnocss, resolveLayersDirs, typescript };
181
+ export { applyLayerModules, applyLayers, config, createVixtPlugin, defineVitePlugin, defineVixtConfig, defineVixtModule, findUpWorkspaceDir, generateAppConfig, generateClient, generateCss, generateIndexHtml, generatePlugins, installModule, isSamePath, loadEnv, loadVixt, loadVixtConfig, loadWorkspaceEnv, resolveLayersDirs, typescript };
188
182
  export type { AppHead, AppOptions, ModuleDefinition, ModuleMeta, ModuleOptions, PluginOptions, TypescriptOptions, Vixt, VixtConfigLayer, VixtConfigLayerMeta, VixtModule, VixtOptions };
@@ -176,13 +176,7 @@ declare function generateCss(options: AppOptions): string;
176
176
 
177
177
  declare function generateIndexHtml(options: AppOptions, vixt: Vixt): string;
178
178
 
179
- /**
180
- * compatible unocss v66.0.0 to vite v7.0.0
181
- * `[unocss:global:build:scan] cssPlugins.get(...).transform.call is not a function`
182
- */
183
- declare function patchUnocss(): void;
184
-
185
179
  declare function generatePlugins(vixt: Vixt): string;
186
180
 
187
- export { applyLayerModules, applyLayers, config, createVixtPlugin, defineVitePlugin, defineVixtConfig, defineVixtModule, findUpWorkspaceDir, generateAppConfig, generateClient, generateCss, generateIndexHtml, generatePlugins, installModule, isSamePath, loadEnv, loadVixt, loadVixtConfig, loadWorkspaceEnv, patchUnocss, resolveLayersDirs, typescript };
181
+ export { applyLayerModules, applyLayers, config, createVixtPlugin, defineVitePlugin, defineVixtConfig, defineVixtModule, findUpWorkspaceDir, generateAppConfig, generateClient, generateCss, generateIndexHtml, generatePlugins, installModule, isSamePath, loadEnv, loadVixt, loadVixtConfig, loadWorkspaceEnv, resolveLayersDirs, typescript };
188
182
  export type { AppHead, AppOptions, ModuleDefinition, ModuleMeta, ModuleOptions, PluginOptions, TypescriptOptions, Vixt, VixtConfigLayer, VixtConfigLayerMeta, VixtModule, VixtOptions };
@@ -6,7 +6,7 @@ import { cac } from 'cac';
6
6
  import { findUpSync } from 'find-up';
7
7
  import { loadEnv as loadEnv$1 } from 'vite';
8
8
  import defu from 'defu';
9
- import { pathToFileURL, resolvePathSync } from 'mlly';
9
+ import { pathToFileURL } from 'mlly';
10
10
  import 'tsx/esm';
11
11
  import Checker from 'vite-plugin-checker';
12
12
 
@@ -128,16 +128,16 @@ async function applyLayerModules(layers) {
128
128
  for (const m of modulesDirs.reverse()) {
129
129
  if (fs.existsSync(m)) {
130
130
  const files = fs.readdirSync(m);
131
- for (const f of files) {
132
- const p = path.resolve(m, f);
131
+ for (const f of files.filter((f2) => !f2.includes(".") || /\.[jt]s$/.test(f2))) {
133
132
  try {
133
+ const fileURL = pathToFileURL(path.resolve(m, f));
134
134
  const module = await import(
135
135
  /* @vite-ignore */
136
- pathToFileURL(p)
136
+ fileURL
137
137
  ).then((m2) => m2.default);
138
138
  modules.push(module);
139
139
  } catch (error) {
140
- console.error("[LoadVixtModule Error]:", error);
140
+ console.error("[VixtModule Error]:", error);
141
141
  }
142
142
  }
143
143
  }
@@ -398,20 +398,6 @@ ${noscriptTemplate}
398
398
  return code;
399
399
  }
400
400
 
401
- function patchUnocss() {
402
- const filePath = resolvePathSync("@unocss/vite");
403
- let fileContent = fs.readFileSync(filePath, "utf-8");
404
- if (fileContent.includes(`const result = await cssPlugins.get(dir).transform.call(ctx2, css, id);`)) {
405
- fileContent = fileContent.replace(
406
- `const result = await cssPlugins.get(dir).transform.call(ctx2, css, id);`,
407
- `const cssPlugin = cssPlugins.get(dir);
408
- const cssPluginTransformHandler = "handler" in cssPlugin.transform ? cssPlugin.transform.handler : cssPlugin.transform;
409
- const result = await cssPluginTransformHandler.call(ctx2, css, id);`
410
- );
411
- fs.writeFileSync(filePath, fileContent);
412
- }
413
- }
414
-
415
401
  function generatePlugins(vixt) {
416
402
  const { plugins: pluginsDirs = [] } = resolveLayersDirs(vixt._layers);
417
403
  let pluginsImportTemplate = "";
@@ -468,4 +454,4 @@ function createVixtPlugin(loadOptions) {
468
454
  });
469
455
  }
470
456
 
471
- export { applyLayerModules, applyLayers, config, createVixtPlugin, defineVitePlugin, defineVixtConfig, defineVixtModule, findUpWorkspaceDir, generateAppConfig, generateClient, generateCss, generateIndexHtml, generatePlugins, installModule, isSamePath, loadEnv, loadVixt, loadVixtConfig, loadWorkspaceEnv, patchUnocss, resolveLayersDirs, typescript };
457
+ export { applyLayerModules, applyLayers, config, createVixtPlugin, defineVitePlugin, defineVixtConfig, defineVixtModule, findUpWorkspaceDir, generateAppConfig, generateClient, generateCss, generateIndexHtml, generatePlugins, installModule, isSamePath, loadEnv, loadVixt, loadVixtConfig, loadWorkspaceEnv, resolveLayersDirs, typescript };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vixt/core",
3
3
  "type": "module",
4
- "version": "0.5.5",
4
+ "version": "0.5.7",
5
5
  "author": "SoulLyoko<https://github.com/SoulLyoko>",
6
6
  "license": "MIT",
7
7
  "homepage": "https://soullyoko.github.io/vixt/",
@@ -33,7 +33,7 @@
33
33
  "dependencies": {
34
34
  "@types/fs-extra": "^11.0.4",
35
35
  "@vue/tsconfig": "^0.7.0",
36
- "c12": "^3.0.4",
36
+ "c12": "^3.1.0",
37
37
  "cac": "^6.7.14",
38
38
  "defu": "^6.1.4",
39
39
  "find-up": "^7.0.0",
@@ -42,8 +42,8 @@
42
42
  "pathe": "^2.0.3",
43
43
  "pkg-types": "^2.2.0",
44
44
  "tsx": "^4.20.3",
45
- "vite": "^7.0.3",
46
- "vite-plugin-checker": "^0.10.0"
45
+ "vite": "^7.0.5",
46
+ "vite-plugin-checker": "^0.10.1"
47
47
  },
48
48
  "scripts": {
49
49
  "build": "unbuild",