@vixt/core 0.0.10 → 0.0.11

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
@@ -116,6 +116,7 @@ declare function defineVixtConfig(input: VixtOptions): VixtOptions;
116
116
  declare const rootDir: string;
117
117
  declare const buildDir = ".vixt";
118
118
  declare const buildTypesDir = ".vixt/types";
119
+ declare const buildLayersDir = ".vixt/layers";
119
120
  declare function loadVixtConfig(opts?: LoadConfigOptions<VixtOptions>): Promise<c12.ResolvedConfig<VixtOptions, c12.ConfigLayerMeta>>;
120
121
  declare function resolveLayersDirs(layers?: VixtConfigLayer[]): Record<string, string[] | undefined>;
121
122
 
@@ -127,4 +128,4 @@ declare function applyLayerModules(layers?: VixtConfigLayer[]): Promise<VixtModu
127
128
  declare function loadVixt(opts?: LoadConfigOptions<VixtOptions>): Promise<Vixt>;
128
129
  declare function createVixtPlugin(loadOptions: LoadConfigOptions<VixtOptions>): (options?: VixtOptions | undefined) => vite.PluginOption;
129
130
 
130
- export { type AppHead, type AppOptions, type ModuleDefinition, type ModuleMeta, type ModuleOptions, type PluginOptions, type TypescriptOptions, type Vixt, type VixtConfigLayer, type VixtModule, type VixtOptions, alias, app, applyLayerModules, buildDir, buildTypesDir, config, createVixtPlugin, defineVitePlugin, defineVixtConfig, defineVixtModule, installModule, loadVixt, loadVixtConfig, resolveLayersDirs, rootDir, typescript };
131
+ export { type AppHead, type AppOptions, type ModuleDefinition, type ModuleMeta, type ModuleOptions, type PluginOptions, type TypescriptOptions, type Vixt, type VixtConfigLayer, type VixtModule, type VixtOptions, alias, app, applyLayerModules, buildDir, buildLayersDir, buildTypesDir, config, createVixtPlugin, defineVitePlugin, defineVixtConfig, defineVixtModule, installModule, loadVixt, loadVixtConfig, resolveLayersDirs, rootDir, typescript };
package/dist/index.d.ts CHANGED
@@ -116,6 +116,7 @@ declare function defineVixtConfig(input: VixtOptions): VixtOptions;
116
116
  declare const rootDir: string;
117
117
  declare const buildDir = ".vixt";
118
118
  declare const buildTypesDir = ".vixt/types";
119
+ declare const buildLayersDir = ".vixt/layers";
119
120
  declare function loadVixtConfig(opts?: LoadConfigOptions<VixtOptions>): Promise<c12.ResolvedConfig<VixtOptions, c12.ConfigLayerMeta>>;
120
121
  declare function resolveLayersDirs(layers?: VixtConfigLayer[]): Record<string, string[] | undefined>;
121
122
 
@@ -127,4 +128,4 @@ declare function applyLayerModules(layers?: VixtConfigLayer[]): Promise<VixtModu
127
128
  declare function loadVixt(opts?: LoadConfigOptions<VixtOptions>): Promise<Vixt>;
128
129
  declare function createVixtPlugin(loadOptions: LoadConfigOptions<VixtOptions>): (options?: VixtOptions | undefined) => vite.PluginOption;
129
130
 
130
- export { type AppHead, type AppOptions, type ModuleDefinition, type ModuleMeta, type ModuleOptions, type PluginOptions, type TypescriptOptions, type Vixt, type VixtConfigLayer, type VixtModule, type VixtOptions, alias, app, applyLayerModules, buildDir, buildTypesDir, config, createVixtPlugin, defineVitePlugin, defineVixtConfig, defineVixtModule, installModule, loadVixt, loadVixtConfig, resolveLayersDirs, rootDir, typescript };
131
+ export { type AppHead, type AppOptions, type ModuleDefinition, type ModuleMeta, type ModuleOptions, type PluginOptions, type TypescriptOptions, type Vixt, type VixtConfigLayer, type VixtModule, type VixtOptions, alias, app, applyLayerModules, buildDir, buildLayersDir, buildTypesDir, config, createVixtPlugin, defineVitePlugin, defineVixtConfig, defineVixtModule, installModule, loadVixt, loadVixtConfig, resolveLayersDirs, rootDir, typescript };
package/dist/index.mjs CHANGED
@@ -33,9 +33,10 @@ const alias = defineVixtModule({
33
33
  function defineVixtConfig(input) {
34
34
  return input;
35
35
  }
36
- const rootDir = cwd();
36
+ const rootDir = path.resolve(cwd());
37
37
  const buildDir = ".vixt";
38
38
  const buildTypesDir = `${buildDir}/types`;
39
+ const buildLayersDir = `${buildDir}/layers`;
39
40
  async function loadVixtConfig(opts) {
40
41
  const result = await loadConfig({
41
42
  name: "vixt",
@@ -48,7 +49,14 @@ async function loadVixtConfig(opts) {
48
49
  ...opts?.defaults
49
50
  }
50
51
  });
51
- result.layers = result.layers?.filter((e) => e.cwd);
52
+ result.layers = result.layers?.filter((e) => e.cwd).map((e) => {
53
+ if (e.cwd !== rootDir) {
54
+ const newCwd = path.resolve(rootDir, buildLayersDir, e.cwd.split("/").pop());
55
+ fs.copySync(e.cwd, newCwd, { filter: (src) => !/node_modules|tsconfig/.test(src) });
56
+ return { ...e, relatedCwd: e.cwd, cwd: newCwd };
57
+ }
58
+ return e;
59
+ });
52
60
  return result;
53
61
  }
54
62
  function resolveLayersDirs(layers = []) {
@@ -323,4 +331,4 @@ function createVixtPlugin(loadOptions) {
323
331
  });
324
332
  }
325
333
 
326
- export { alias, app, applyLayerModules, buildDir, buildTypesDir, config, createVixtPlugin, defineVitePlugin, defineVixtConfig, defineVixtModule, installModule, loadVixt, loadVixtConfig, resolveLayersDirs, rootDir, typescript };
334
+ export { alias, app, applyLayerModules, buildDir, buildLayersDir, buildTypesDir, config, createVixtPlugin, defineVitePlugin, defineVixtConfig, defineVixtModule, installModule, loadVixt, loadVixtConfig, resolveLayersDirs, rootDir, typescript };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vixt/core",
3
3
  "type": "module",
4
- "version": "0.0.10",
4
+ "version": "0.0.11",
5
5
  "author": "SoulLyoko<https://github.com/SoulLyoko>",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/SoulLyoko/vixt#readme",