@vixt/core 0.5.17 → 0.6.1
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.ts +21 -8
- package/dist/client/index.js +28 -0
- package/dist/node/index.d.mts +259 -148
- package/dist/node/index.mjs +585 -399
- package/package.json +14 -19
- package/dist/client/index.d.mts +0 -18
- package/dist/client/index.mjs +0 -11
- package/dist/node/index.d.ts +0 -182
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vixt/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.6.1",
|
|
5
5
|
"author": "SoulLyoko<https://github.com/SoulLyoko>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://soullyoko.github.io/vixt/",
|
|
@@ -16,37 +16,32 @@
|
|
|
16
16
|
"react"
|
|
17
17
|
],
|
|
18
18
|
"exports": {
|
|
19
|
-
".":
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
"./client": {
|
|
24
|
-
"types": "./dist/client/index.d.ts",
|
|
25
|
-
"import": "./dist/client/index.mjs"
|
|
26
|
-
}
|
|
19
|
+
".": "./dist/node/index.mjs",
|
|
20
|
+
"./client": "./dist/client/index.js",
|
|
21
|
+
"./package.json": "./package.json"
|
|
27
22
|
},
|
|
28
23
|
"main": "./dist/node/index.mjs",
|
|
29
|
-
"types": "./dist/node/index.d.
|
|
24
|
+
"types": "./dist/node/index.d.mts",
|
|
25
|
+
"browser": "./dist/client/index.js",
|
|
30
26
|
"files": [
|
|
31
27
|
"dist"
|
|
32
28
|
],
|
|
33
29
|
"dependencies": {
|
|
34
30
|
"@types/fs-extra": "^11.0.4",
|
|
31
|
+
"@vitejs/plugin-basic-ssl": "^2.1.0",
|
|
32
|
+
"@vitejs/plugin-legacy": "^7.2.1",
|
|
35
33
|
"@vue/tsconfig": "^0.8.1",
|
|
36
|
-
"c12": "^3.3.
|
|
34
|
+
"c12": "^3.3.3",
|
|
37
35
|
"cac": "^6.7.14",
|
|
38
36
|
"defu": "^6.1.4",
|
|
39
37
|
"find-up": "^8.0.0",
|
|
40
|
-
"fs-extra": "^11.3.
|
|
38
|
+
"fs-extra": "^11.3.3",
|
|
39
|
+
"jiti": "^2.6.1",
|
|
41
40
|
"mlly": "^1.8.0",
|
|
42
41
|
"pathe": "^2.0.3",
|
|
43
42
|
"pkg-types": "^2.3.0",
|
|
44
|
-
"
|
|
45
|
-
"vite": "^
|
|
46
|
-
"vite-plugin-checker": "^0.
|
|
47
|
-
},
|
|
48
|
-
"scripts": {
|
|
49
|
-
"build": "unbuild",
|
|
50
|
-
"dev": "unbuild --stub"
|
|
43
|
+
"vite": "^7.3.0",
|
|
44
|
+
"vite-bundle-analyzer": "^1.3.2",
|
|
45
|
+
"vite-plugin-checker": "^0.12.0"
|
|
51
46
|
}
|
|
52
47
|
}
|
package/dist/client/index.d.mts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
interface VixtApp {
|
|
2
|
-
appConfig: VixtAppConfig;
|
|
3
|
-
}
|
|
4
|
-
interface VixtAppConfig extends Record<string, any> {
|
|
5
|
-
}
|
|
6
|
-
declare function defineAppConfig(config: VixtAppConfig): VixtAppConfig;
|
|
7
|
-
|
|
8
|
-
interface PluginDefinition {
|
|
9
|
-
name?: string;
|
|
10
|
-
setup?: (this: void, vixt: VixtApp) => any;
|
|
11
|
-
}
|
|
12
|
-
interface VixtPlugin {
|
|
13
|
-
(this: void, vixt: VixtApp): any;
|
|
14
|
-
}
|
|
15
|
-
declare function defineVixtPlugin(definition: PluginDefinition | VixtPlugin): VixtPlugin;
|
|
16
|
-
|
|
17
|
-
export { defineAppConfig, defineVixtPlugin };
|
|
18
|
-
export type { PluginDefinition, VixtApp, VixtAppConfig, VixtPlugin };
|
package/dist/client/index.mjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
function defineAppConfig(config) {
|
|
2
|
-
return config;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
function defineVixtPlugin(definition) {
|
|
6
|
-
if (typeof definition == "function")
|
|
7
|
-
return defineVixtPlugin({ setup: definition });
|
|
8
|
-
return (vixt) => definition.setup?.(vixt);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export { defineAppConfig, defineVixtPlugin };
|
package/dist/node/index.d.ts
DELETED
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import * as c12 from 'c12';
|
|
2
|
-
import { LoadConfigOptions, ConfigLayer, ConfigLayerMeta } from 'c12';
|
|
3
|
-
import * as vite from 'vite';
|
|
4
|
-
import { PluginOption, ResolvedConfig } from 'vite';
|
|
5
|
-
import { RawVueCompilerOptions } from '@vue/language-core';
|
|
6
|
-
import { TSConfig } from 'pkg-types';
|
|
7
|
-
import Checker from 'vite-plugin-checker';
|
|
8
|
-
|
|
9
|
-
type Property = Record<string, string>;
|
|
10
|
-
interface AppHead {
|
|
11
|
-
meta?: Property[];
|
|
12
|
-
link?: Property[];
|
|
13
|
-
style?: Property[];
|
|
14
|
-
script?: Property[];
|
|
15
|
-
title?: Property[];
|
|
16
|
-
noscript?: Property[];
|
|
17
|
-
}
|
|
18
|
-
interface AppOptions {
|
|
19
|
-
head?: AppHead;
|
|
20
|
-
/**
|
|
21
|
-
* @default /
|
|
22
|
-
*/
|
|
23
|
-
baseURL?: string;
|
|
24
|
-
/**
|
|
25
|
-
* @default 'app'
|
|
26
|
-
*/
|
|
27
|
-
rootId?: string;
|
|
28
|
-
/**
|
|
29
|
-
* @default 'div'
|
|
30
|
-
*/
|
|
31
|
-
rootTag?: string;
|
|
32
|
-
/** inject css files */
|
|
33
|
-
css?: string[];
|
|
34
|
-
/**
|
|
35
|
-
* @default './loading.html'
|
|
36
|
-
*/
|
|
37
|
-
loadingTemplate?: string;
|
|
38
|
-
/**
|
|
39
|
-
* @default '/src/main.ts'(vue)
|
|
40
|
-
* @default '/src/main.tsx'(react)
|
|
41
|
-
* @example 'entry.ts'(means '/src/entry.ts') or './entry.ts'
|
|
42
|
-
*/
|
|
43
|
-
entryFile?: string;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
interface Vixt {
|
|
47
|
-
options: VixtOptions;
|
|
48
|
-
_layers: VixtConfigLayer[];
|
|
49
|
-
_modules: VixtModule[];
|
|
50
|
-
}
|
|
51
|
-
declare function loadVixt(opts?: LoadConfigOptions<VixtOptions>): Promise<Vixt>;
|
|
52
|
-
declare function createVixtPlugin(loadOptions: LoadConfigOptions<VixtOptions>): (options?: VixtOptions | undefined) => vite.PluginOption;
|
|
53
|
-
|
|
54
|
-
type PluginOptions<Options = any> = (Options extends (...args: any[]) => any ? Parameters<Options>[0] : Options);
|
|
55
|
-
type ModuleOptions = Record<string, any>;
|
|
56
|
-
interface ModuleMeta extends Record<string, any> {
|
|
57
|
-
name?: string;
|
|
58
|
-
configKey?: string;
|
|
59
|
-
}
|
|
60
|
-
interface ModuleDefinition<T extends ModuleOptions = ModuleOptions> {
|
|
61
|
-
meta?: ModuleMeta;
|
|
62
|
-
defaults?: T | ((vixt: Vixt) => T);
|
|
63
|
-
setup?: (this: void, resolvedOptions: T, vixt: Vixt) => PluginOption | void;
|
|
64
|
-
}
|
|
65
|
-
interface VixtModule<T extends ModuleOptions = ModuleOptions> {
|
|
66
|
-
(this: void, inlineOptions: T, vixt: Vixt): PluginOption;
|
|
67
|
-
getOptions?: (inlineOptions?: T, Vixt?: Vixt) => T;
|
|
68
|
-
getMeta?: () => ModuleMeta;
|
|
69
|
-
}
|
|
70
|
-
declare function defineVitePlugin<Options = any>(pluginFn: (options?: Options) => PluginOption): (options?: Options) => PluginOption;
|
|
71
|
-
declare function defineVixtModule<T extends ModuleOptions>(definition: ModuleDefinition<T> | VixtModule<T>): VixtModule<T>;
|
|
72
|
-
declare function installModule(module: VixtModule, inlineOptions: any, vixt: Vixt): PluginOption;
|
|
73
|
-
declare function applyLayerModules(layers: VixtConfigLayer[]): Promise<VixtModule[]>;
|
|
74
|
-
|
|
75
|
-
interface VixtOptions extends Record<string, any> {
|
|
76
|
-
/**
|
|
77
|
-
* @default process.cwd()
|
|
78
|
-
*/
|
|
79
|
-
rootDir?: string;
|
|
80
|
-
/**
|
|
81
|
-
* @default '<rootDir>/.vixt'
|
|
82
|
-
*/
|
|
83
|
-
buildDir?: string;
|
|
84
|
-
/**
|
|
85
|
-
* @default '<buildDir>/types'
|
|
86
|
-
*/
|
|
87
|
-
buildTypesDir?: string;
|
|
88
|
-
/**
|
|
89
|
-
* @default '<buildDir>/layers'
|
|
90
|
-
*/
|
|
91
|
-
buildLayersDir?: string;
|
|
92
|
-
/**
|
|
93
|
-
* @default '<buildDir>/imports'
|
|
94
|
-
*/
|
|
95
|
-
buildImportsDir?: string;
|
|
96
|
-
/**
|
|
97
|
-
* @default '<rootDir>/src'
|
|
98
|
-
*/
|
|
99
|
-
srcDir?: string;
|
|
100
|
-
/** modules */
|
|
101
|
-
modules?: VixtModule[];
|
|
102
|
-
/** use on configResolved */
|
|
103
|
-
vite?: ResolvedConfig;
|
|
104
|
-
meta?: VixtConfigLayerMeta;
|
|
105
|
-
/** layers */
|
|
106
|
-
extends?: string[];
|
|
107
|
-
app?: AppOptions;
|
|
108
|
-
}
|
|
109
|
-
interface VixtConfigLayerMeta extends ConfigLayerMeta {
|
|
110
|
-
/** layer name */
|
|
111
|
-
name?: string;
|
|
112
|
-
/** layer alias */
|
|
113
|
-
alias?: string;
|
|
114
|
-
}
|
|
115
|
-
interface VixtConfigLayer extends ConfigLayer<VixtOptions, VixtConfigLayerMeta> {
|
|
116
|
-
/** when layer is in node_modules, layer will copy to `<buildLayersDir>/<layerName>`, and change cwd */
|
|
117
|
-
cwd?: string;
|
|
118
|
-
}
|
|
119
|
-
declare function defineVixtConfig(input: VixtOptions): VixtOptions;
|
|
120
|
-
declare function loadVixtConfig(opts?: LoadConfigOptions<VixtOptions>): Promise<c12.ResolvedConfig<VixtOptions, ConfigLayerMeta>>;
|
|
121
|
-
declare function applyLayers(layers: VixtConfigLayer[], config: VixtOptions): {
|
|
122
|
-
meta: VixtConfigLayerMeta;
|
|
123
|
-
/** when layer is in node_modules, layer will copy to `<buildLayersDir>/<layerName>`, and change cwd */
|
|
124
|
-
cwd?: string;
|
|
125
|
-
config: VixtOptions | null;
|
|
126
|
-
source?: string;
|
|
127
|
-
sourceOptions?: c12.SourceOptions<VixtOptions, VixtConfigLayerMeta> | undefined;
|
|
128
|
-
configFile?: string;
|
|
129
|
-
}[];
|
|
130
|
-
declare function isSamePath(a: string, b: string): boolean;
|
|
131
|
-
declare function resolveLayersDirs(layers?: VixtConfigLayer[]): Record<string, string[] | undefined>;
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Load workspace and cwd env variables by default
|
|
135
|
-
*/
|
|
136
|
-
declare function loadEnv(mode?: string, envDir?: string | false, prefixes?: string | string[]): ImportMeta["env"];
|
|
137
|
-
/**
|
|
138
|
-
* find the workspace dir
|
|
139
|
-
*/
|
|
140
|
-
declare function findUpWorkspaceDir(): string | undefined;
|
|
141
|
-
/**
|
|
142
|
-
* Load workspace env variables
|
|
143
|
-
*/
|
|
144
|
-
declare function loadWorkspaceEnv(mode?: string, prefixes?: string | string[]): Record<string, string>;
|
|
145
|
-
|
|
146
|
-
declare const config: VixtModule<ModuleOptions>;
|
|
147
|
-
|
|
148
|
-
declare module '@vixt/core' {
|
|
149
|
-
interface VixtOptions {
|
|
150
|
-
typescript?: TypescriptOptions;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
interface TypescriptOptions {
|
|
154
|
-
references?: (string | {
|
|
155
|
-
path?: string;
|
|
156
|
-
content?: string;
|
|
157
|
-
})[];
|
|
158
|
-
tsConfig?: TSConfig & {
|
|
159
|
-
vueCompilerOptions?: RawVueCompilerOptions;
|
|
160
|
-
};
|
|
161
|
-
/** https://github.com/fi3ework/vite-plugin-checker */
|
|
162
|
-
typeCheck?: Parameters<typeof Checker>[0];
|
|
163
|
-
/**
|
|
164
|
-
* Generate a `*.vue` shim
|
|
165
|
-
* @default false
|
|
166
|
-
*/
|
|
167
|
-
shim?: boolean;
|
|
168
|
-
}
|
|
169
|
-
declare const typescript: VixtModule<TypescriptOptions>;
|
|
170
|
-
|
|
171
|
-
declare function generateAppConfig(vixt: Vixt): string;
|
|
172
|
-
|
|
173
|
-
declare function generateClient(vixt: Vixt): void;
|
|
174
|
-
|
|
175
|
-
declare function generateCss(options: AppOptions): string;
|
|
176
|
-
|
|
177
|
-
declare function generateIndexHtml(options: AppOptions, vixt: Vixt): string;
|
|
178
|
-
|
|
179
|
-
declare function generatePlugins(vixt: Vixt): string;
|
|
180
|
-
|
|
181
|
-
export { applyLayerModules, applyLayers, config, createVixtPlugin, defineVitePlugin, defineVixtConfig, defineVixtModule, findUpWorkspaceDir, generateAppConfig, generateClient, generateCss, generateIndexHtml, generatePlugins, installModule, isSamePath, loadEnv, loadVixt, loadVixtConfig, loadWorkspaceEnv, resolveLayersDirs, typescript };
|
|
182
|
-
export type { AppHead, AppOptions, ModuleDefinition, ModuleMeta, ModuleOptions, PluginOptions, TypescriptOptions, Vixt, VixtConfigLayer, VixtConfigLayerMeta, VixtModule, VixtOptions };
|