@vixt/core 0.1.15 → 0.1.17
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/client/index.d.mts +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/index.d.mts +11 -3
- package/dist/index.d.ts +11 -3
- package/dist/index.mjs +16 -8
- package/dist/shared/{core.c818f21a.d.mts → core.3b42a3cd.d.mts} +1 -1
- package/dist/shared/{core.c818f21a.d.ts → core.3b42a3cd.d.ts} +1 -1
- package/package.json +4 -3
package/dist/client/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { App, Plugin } from 'vue';
|
|
2
2
|
import { Router, RouteRecord } from 'vue-router';
|
|
3
3
|
import { Pinia } from 'pinia';
|
|
4
|
-
import { f as VixtAppConfig } from '../shared/core.
|
|
4
|
+
import { f as VixtAppConfig } from '../shared/core.3b42a3cd.mjs';
|
|
5
5
|
import 'vite';
|
|
6
6
|
import 'c12';
|
|
7
7
|
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { App, Plugin } from 'vue';
|
|
2
2
|
import { Router, RouteRecord } from 'vue-router';
|
|
3
3
|
import { Pinia } from 'pinia';
|
|
4
|
-
import { f as VixtAppConfig } from '../shared/core.
|
|
4
|
+
import { f as VixtAppConfig } from '../shared/core.3b42a3cd.js';
|
|
5
5
|
import 'vite';
|
|
6
6
|
import 'c12';
|
|
7
7
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { V as Vixt, a as VixtModule, M as ModuleOptions, b as VixtOptions, c as VixtConfigLayer, d as ModuleDefinition } from './shared/core.
|
|
2
|
-
export { g as ModuleMeta, P as PluginOptions, f as VixtAppConfig
|
|
1
|
+
import { V as Vixt, a as VixtModule, M as ModuleOptions, b as VixtOptions, c as VixtConfigLayer, d as VixtConfigLayerMeta, e as ModuleDefinition } from './shared/core.3b42a3cd.mjs';
|
|
2
|
+
export { g as ModuleMeta, P as PluginOptions, f as VixtAppConfig } from './shared/core.3b42a3cd.mjs';
|
|
3
3
|
import { TSConfig } from 'pkg-types';
|
|
4
4
|
import { RawVueCompilerOptions } from '@vue/language-core';
|
|
5
5
|
import Checker from 'vite-plugin-checker';
|
|
@@ -74,6 +74,14 @@ declare const typescript: VixtModule<TypescriptOptions>;
|
|
|
74
74
|
|
|
75
75
|
declare function defineVixtConfig(input: VixtOptions): VixtOptions;
|
|
76
76
|
declare function loadVixtConfig(opts?: LoadConfigOptions<VixtOptions>): Promise<c12.ResolvedConfig<VixtOptions, c12.ConfigLayerMeta>>;
|
|
77
|
+
declare function applyLayers(layers: VixtConfigLayer[], config: VixtOptions): {
|
|
78
|
+
meta: VixtConfigLayerMeta;
|
|
79
|
+
cwd?: string;
|
|
80
|
+
config: VixtOptions | null;
|
|
81
|
+
source?: string;
|
|
82
|
+
sourceOptions?: c12.SourceOptions<VixtOptions, VixtConfigLayerMeta> | undefined;
|
|
83
|
+
configFile?: string;
|
|
84
|
+
}[];
|
|
77
85
|
declare function isSamePath(a: string, b: string): boolean;
|
|
78
86
|
declare function resolveLayersDirs(layers: VixtConfigLayer[] | undefined, config: VixtOptions): Record<string, string[] | undefined>;
|
|
79
87
|
|
|
@@ -94,4 +102,4 @@ declare function applyLayerModules(layers: VixtConfigLayer[], config: VixtOption
|
|
|
94
102
|
declare function loadVixt(opts?: LoadConfigOptions<VixtOptions>): Promise<Vixt>;
|
|
95
103
|
declare function createVixtPlugin(loadOptions: LoadConfigOptions<VixtOptions>): (options?: VixtOptions | undefined) => vite.PluginOption;
|
|
96
104
|
|
|
97
|
-
export { type AppHead, type AppOptions, ModuleDefinition, ModuleOptions, type TypescriptOptions, Vixt, VixtConfigLayer, VixtModule, type VixtOptions, app, applyLayerModules, config, createVixtPlugin, defineVitePlugin, defineVixtConfig, defineVixtModule, installModule, isSamePath, loadEnv, loadVixt, loadVixtConfig, loadWorkspaceEnv, resolveLayersDirs, typescript };
|
|
105
|
+
export { type AppHead, type AppOptions, ModuleDefinition, ModuleOptions, type TypescriptOptions, Vixt, VixtConfigLayer, VixtConfigLayerMeta, VixtModule, type VixtOptions, app, applyLayerModules, applyLayers, config, createVixtPlugin, defineVitePlugin, defineVixtConfig, defineVixtModule, installModule, isSamePath, loadEnv, loadVixt, loadVixtConfig, loadWorkspaceEnv, resolveLayersDirs, typescript };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { V as Vixt, a as VixtModule, M as ModuleOptions, b as VixtOptions, c as VixtConfigLayer, d as ModuleDefinition } from './shared/core.
|
|
2
|
-
export { g as ModuleMeta, P as PluginOptions, f as VixtAppConfig
|
|
1
|
+
import { V as Vixt, a as VixtModule, M as ModuleOptions, b as VixtOptions, c as VixtConfigLayer, d as VixtConfigLayerMeta, e as ModuleDefinition } from './shared/core.3b42a3cd.js';
|
|
2
|
+
export { g as ModuleMeta, P as PluginOptions, f as VixtAppConfig } from './shared/core.3b42a3cd.js';
|
|
3
3
|
import { TSConfig } from 'pkg-types';
|
|
4
4
|
import { RawVueCompilerOptions } from '@vue/language-core';
|
|
5
5
|
import Checker from 'vite-plugin-checker';
|
|
@@ -74,6 +74,14 @@ declare const typescript: VixtModule<TypescriptOptions>;
|
|
|
74
74
|
|
|
75
75
|
declare function defineVixtConfig(input: VixtOptions): VixtOptions;
|
|
76
76
|
declare function loadVixtConfig(opts?: LoadConfigOptions<VixtOptions>): Promise<c12.ResolvedConfig<VixtOptions, c12.ConfigLayerMeta>>;
|
|
77
|
+
declare function applyLayers(layers: VixtConfigLayer[], config: VixtOptions): {
|
|
78
|
+
meta: VixtConfigLayerMeta;
|
|
79
|
+
cwd?: string;
|
|
80
|
+
config: VixtOptions | null;
|
|
81
|
+
source?: string;
|
|
82
|
+
sourceOptions?: c12.SourceOptions<VixtOptions, VixtConfigLayerMeta> | undefined;
|
|
83
|
+
configFile?: string;
|
|
84
|
+
}[];
|
|
77
85
|
declare function isSamePath(a: string, b: string): boolean;
|
|
78
86
|
declare function resolveLayersDirs(layers: VixtConfigLayer[] | undefined, config: VixtOptions): Record<string, string[] | undefined>;
|
|
79
87
|
|
|
@@ -94,4 +102,4 @@ declare function applyLayerModules(layers: VixtConfigLayer[], config: VixtOption
|
|
|
94
102
|
declare function loadVixt(opts?: LoadConfigOptions<VixtOptions>): Promise<Vixt>;
|
|
95
103
|
declare function createVixtPlugin(loadOptions: LoadConfigOptions<VixtOptions>): (options?: VixtOptions | undefined) => vite.PluginOption;
|
|
96
104
|
|
|
97
|
-
export { type AppHead, type AppOptions, ModuleDefinition, ModuleOptions, type TypescriptOptions, Vixt, VixtConfigLayer, VixtModule, type VixtOptions, app, applyLayerModules, config, createVixtPlugin, defineVitePlugin, defineVixtConfig, defineVixtModule, installModule, isSamePath, loadEnv, loadVixt, loadVixtConfig, loadWorkspaceEnv, resolveLayersDirs, typescript };
|
|
105
|
+
export { type AppHead, type AppOptions, ModuleDefinition, ModuleOptions, type TypescriptOptions, Vixt, VixtConfigLayer, VixtConfigLayerMeta, VixtModule, type VixtOptions, app, applyLayerModules, applyLayers, config, createVixtPlugin, defineVitePlugin, defineVixtConfig, defineVixtModule, installModule, isSamePath, loadEnv, loadVixt, loadVixtConfig, loadWorkspaceEnv, resolveLayersDirs, typescript };
|
package/dist/index.mjs
CHANGED
|
@@ -5,8 +5,9 @@ import { pathToFileURL } from 'mlly';
|
|
|
5
5
|
import defu from 'defu';
|
|
6
6
|
import { cwd, env } from 'node:process';
|
|
7
7
|
import { loadConfig } from 'c12';
|
|
8
|
-
import { cac } from 'cac';
|
|
9
8
|
import { loadEnv as loadEnv$1 } from 'vite';
|
|
9
|
+
import { cac } from 'cac';
|
|
10
|
+
import { findUpSync } from 'find-up';
|
|
10
11
|
import Checker from 'vite-plugin-checker';
|
|
11
12
|
|
|
12
13
|
function defineVixtConfig(input) {
|
|
@@ -37,10 +38,9 @@ async function loadVixtConfig(opts) {
|
|
|
37
38
|
...opts?.defaults
|
|
38
39
|
}
|
|
39
40
|
});
|
|
40
|
-
result.layers = mapLayers(result.layers?.filter((e) => e.cwd) ?? [], result.config);
|
|
41
41
|
return result;
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function applyLayers(layers, config) {
|
|
44
44
|
const { rootDir, buildLayersDir } = config;
|
|
45
45
|
return layers.map((layer) => {
|
|
46
46
|
const meta = layer.config?.meta ?? {};
|
|
@@ -311,17 +311,19 @@ function loadEnv(mode, envDir, prefixes) {
|
|
|
311
311
|
};
|
|
312
312
|
}
|
|
313
313
|
function loadWorkspaceEnv(mode, prefixes) {
|
|
314
|
-
|
|
314
|
+
const workspaceManifestLocation = findUpSync(["pnpm-workspace.yaml", "pnpm-workspace.yml"]);
|
|
315
|
+
return workspaceManifestLocation ? loadEnv$1(mode, path.dirname(workspaceManifestLocation), prefixes) : {};
|
|
315
316
|
}
|
|
316
317
|
|
|
317
318
|
const name$1 = "vixt:config";
|
|
318
319
|
const config = defineVixtModule({
|
|
319
320
|
meta: { name: name$1 },
|
|
320
321
|
setup(_, vixt) {
|
|
322
|
+
let env;
|
|
321
323
|
return {
|
|
322
324
|
name: name$1,
|
|
323
325
|
enforce: "pre",
|
|
324
|
-
config() {
|
|
326
|
+
config(config2) {
|
|
325
327
|
const { rootDir, buildDir, srcDir } = vixt.options;
|
|
326
328
|
const defaultAlias = {
|
|
327
329
|
"@": srcDir,
|
|
@@ -335,15 +337,20 @@ const config = defineVixtModule({
|
|
|
335
337
|
}
|
|
336
338
|
}
|
|
337
339
|
defaultAlias["#"] = buildDir;
|
|
340
|
+
env = loadEnv(config2.mode, config2.envDir, config2.envPrefix);
|
|
341
|
+
const defineEnv = Object.fromEntries(
|
|
342
|
+
Object.entries(env).filter(([k]) => !["MODE", "DEV", "PROD"].includes(k)).map(([k, v]) => [`import.meta.env.${k}`, JSON.stringify(v)])
|
|
343
|
+
);
|
|
338
344
|
return {
|
|
339
345
|
root: rootDir,
|
|
340
346
|
resolve: {
|
|
341
347
|
alias: defaultAlias
|
|
342
|
-
}
|
|
348
|
+
},
|
|
349
|
+
define: defineEnv
|
|
343
350
|
};
|
|
344
351
|
},
|
|
345
352
|
configResolved(config2) {
|
|
346
|
-
Object.assign(config2.env, { ...
|
|
353
|
+
Object.assign(config2.env, { ...env, ...config2.env });
|
|
347
354
|
vixt.options.vite = config2;
|
|
348
355
|
},
|
|
349
356
|
configureServer(server) {
|
|
@@ -481,6 +488,7 @@ async function loadVixt(opts) {
|
|
|
481
488
|
if (isForce) {
|
|
482
489
|
fs.removeSync(result.config.buildDir);
|
|
483
490
|
}
|
|
491
|
+
result.layers = applyLayers(result.layers?.filter((e) => e.cwd) ?? [], result.config);
|
|
484
492
|
const layerModules = await applyLayerModules(result.layers ?? [], result.config);
|
|
485
493
|
const vixt = {
|
|
486
494
|
options: result.config,
|
|
@@ -497,4 +505,4 @@ function createVixtPlugin(loadOptions) {
|
|
|
497
505
|
});
|
|
498
506
|
}
|
|
499
507
|
|
|
500
|
-
export { app, applyLayerModules, config, createVixtPlugin, defineVitePlugin, defineVixtConfig, defineVixtModule, installModule, isSamePath, loadEnv, loadVixt, loadVixtConfig, loadWorkspaceEnv, resolveLayersDirs, typescript };
|
|
508
|
+
export { app, applyLayerModules, applyLayers, config, createVixtPlugin, defineVitePlugin, defineVixtConfig, defineVixtModule, installModule, isSamePath, loadEnv, loadVixt, loadVixtConfig, loadWorkspaceEnv, resolveLayersDirs, typescript };
|
|
@@ -78,4 +78,4 @@ interface VixtConfigLayer extends ConfigLayer<VixtOptions, VixtConfigLayerMeta>
|
|
|
78
78
|
interface VixtAppConfig extends Record<string, any> {
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
export type { ModuleOptions as M, PluginOptions as P, Vixt as V, VixtModule as a, VixtOptions as b, VixtConfigLayer as c,
|
|
81
|
+
export type { ModuleOptions as M, PluginOptions as P, Vixt as V, VixtModule as a, VixtOptions as b, VixtConfigLayer as c, VixtConfigLayerMeta as d, ModuleDefinition as e, VixtAppConfig as f, ModuleMeta as g };
|
|
@@ -78,4 +78,4 @@ interface VixtConfigLayer extends ConfigLayer<VixtOptions, VixtConfigLayerMeta>
|
|
|
78
78
|
interface VixtAppConfig extends Record<string, any> {
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
export type { ModuleOptions as M, PluginOptions as P, Vixt as V, VixtModule as a, VixtOptions as b, VixtConfigLayer as c,
|
|
81
|
+
export type { ModuleOptions as M, PluginOptions as P, Vixt as V, VixtModule as a, VixtOptions as b, VixtConfigLayer as c, VixtConfigLayerMeta as d, ModuleDefinition as e, VixtAppConfig as f, ModuleMeta as g };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vixt/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.17",
|
|
5
5
|
"author": "SoulLyoko<https://github.com/SoulLyoko>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/SoulLyoko/vixt#readme",
|
|
@@ -27,15 +27,16 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@types/fs-extra": "11.0.4",
|
|
29
29
|
"@vue/tsconfig": "^0.5.1",
|
|
30
|
-
"c12": "^1.11.
|
|
30
|
+
"c12": "^1.11.2",
|
|
31
31
|
"cac": "^6.7.14",
|
|
32
32
|
"defu": "^6.1.4",
|
|
33
|
+
"find-up": "^7.0.0",
|
|
33
34
|
"fs-extra": "^11.2.0",
|
|
34
35
|
"mlly": "1.7.1",
|
|
35
36
|
"pathe": "^1.1.2",
|
|
36
37
|
"pkg-types": "^1.2.0",
|
|
37
38
|
"tsx": "^4.19.0",
|
|
38
|
-
"vite": "^5.4.
|
|
39
|
+
"vite": "^5.4.3",
|
|
39
40
|
"vite-plugin-checker": "^0.7.2",
|
|
40
41
|
"vue-tsc": "2.0.26"
|
|
41
42
|
},
|